[Dropped] Formula stops working for months 10 thru 12

Discuss the spreadsheet application
Locked
jstack
Posts: 18
Joined: Wed Jun 13, 2018 10:28 pm

[Dropped] Formula stops working for months 10 thru 12

Post by jstack »

I have this formula consisting of multiple IF's (for each month of the year). It works fine for all months thru September. Once it gets to October, I get Err:502. Below is a sample of the formula for one month. I've checked everything I can think of.

IF(MONTH($B288)=6;VLOOKUP($B288;'file:///Y:/Sheet Metal/SM Times in MT/2022 MT Times By WC.ods'#$June.$A$5:$M$35;13;0)
Last edited by MrProgrammer on Thu Sep 22, 2022 6:11 pm, edited 1 time in total.
Reason: Dropped: Perhaps solved; No attachment provided when requested -- MrProgrammer, forum moderator
OpenOffice 4.1.2 on Windows 7
User avatar
MrProgrammer
Moderator
Posts: 4907
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Formula stops working for months 10 thru 12

Post by MrProgrammer »

jstack wrote: Thu Sep 15, 2022 2:05 pm IF(MONTH($B288)=6;VLOOKUP($B288;'file:///Y:/Sheet Metal/SM Times in MT/2022 MT Times By WC.ods'#$June.$A$5:$M$35;13;0)
I count three left parentheses and two right parentheses. If this is just a part of your formula, a partial formula does not help us to diagnose the problem, especially when you show us the piece for June after saying that the problem begins with October. For Err:502, one possibility is discussed in Q24/A24 of the tutorial below.

jstack wrote: Thu Sep 15, 2022 2:05 pm I have this formula consisting of multiple IF's (for each month of the year)
Surely the formula will be shorter if you use VLOOKUP to check the months instead of writing twelve IF statements.
[Tutorial] VLOOKUP questions and answers

But the real problem is that It looks as if you are putting data in separate sheets, one for each month. The task will be much simpler if you put all the data in one sheet, perhaps with a column to identify the month. Then you can use a simple VLOOKUP to find B288's value in the combined data and not have the complication of accessing 12 different sheets. There are ways to make this work with 12 sheets, but it will be complicated. If you are a beginner, avoid that complication.

You seem to have separated your data into multiple files, since I see file name 2022 MY Times By WC.ods. If you ever plan to do cross-year data analysis with Calc it will be much easier when you put all the years in a single file. For example, you can use a pivot table to quickly get year or month summaries. But you can't use a pivot table if your data is spread across multiple files or multiple sheets. You can use a column to identify the year so if you open that file to view the data you can use a filter to show only the subset of interest.
Calc Guide Chapter 8 - Using a Pivot Table   (formerly called Data Pilot)


If you need any additional assistance attach a document demonstrating the difficulty (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the document itself). Be sure to clearly explain your goal. I will not respond further without an attachment and a statement of the goal.


If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the subject field. Select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
karolus
Volunteer
Posts: 1160
Joined: Sat Jul 02, 2011 9:47 am

Re: Formula stops working for months 10 thru 12

Post by karolus »

As always, worse Data-design: individual Files per year :ucrazy: with individual sheets per Month :ucrazy:
AOO4, Libreoffice 6.1 on Rasbian OS (on ARM)
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
Locked