Undesired result - Can anyone figure out why the change of date referenced in formula.

brockk

Board Regular
Joined
Jul 1, 2006
Messages
170
Office Version
  1. 2013
Platform
  1. Web
Book1
ABCDEFGHIJKLM
1
2
3HOLIDAY# VALUE
41/1/2023
5HOLIDAYDATEWKDAYSALESACC SALES1/16/2023
6 12/16/2023S2/20/2023
7 12/17/2023S5/29/2023
8 12/18/2023M6/19/2023
9 12/19/2023T7/4/2023
10 12/20/2023W9/4/2023
11 12/21/2023T10/9/2023
12 12/22/2023F11/23/202345253
13 12/23/2023S12/25/202345285
14 12/24/2023S
15 12/25/2023MIN A15, SHOULD APPEAR "HOLIDAY" BUT IT STAYS IN BLANK.
16 12/26/2023TI checked the formula with Evaluate Formula and at 1st stage
17 12/27/2023Wit reads correctly comparing if lookup of 45285 (12/25/23) is within
18 12/28/2023Tthe lookup range BUT, somehow when I continue to evaluate
19 12/29/2023Fit magically changes the 45285 date to 45253 (11/23/23) and I
20 12/30/2023Sdon't understand why? I'm using the same formula throughout
21 12/31/2023Sthe whole workbook and with the exception of Christmas' date
22ALL other occasion presented perfectly. Why is it giving me this
23issue precisely on the very last Holiday of the year? I'm wondering
24if there's anything wrong with the formula or is it some type of glitch
25in Excel? Either way, if any of you Gurus can help me figure this out
26I would truly appreciate the assist.
27
Sheet1
Cell Formulas
RangeFormula
A6:A21A6=IFERROR(IF(LOOKUP($B6,$G$4:$G$13)=$B6,"HOLIDAY",""),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D6:D21Expression=$C6="S"textNO





Greetings,

Can anyone figure out why when it is comparing whether the dates in column B are Holidays based on a lookup of a range of Holiday dates. It seems that somehow when I verify the formula by means of the Formula --> Evaluate Formula option it initiates calculating correctly searching if B15 (12/25/23 or # value 45285) is identified as a Holiday in the range $G$4:$G$13 and if it finds it, it should identify it as "Holiday" otherwise leave in blank. So as I was saying, it initiates by recognizing the 45285 as the comparison date yet, it magically changes to 45253 somehow? and continues to evaluate the rest of the formula obviously given me an undesired result. The funny thing is on all of the worksheets it has worked flawlessly, its only giving me this issue specifically on this worksheet. Can anyone kindly help me figure where is the issue and if there is a correction for this. Thank you in advance.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Best guess is that some of your dates are text & not proper dates. If you change the cell format for all the dates cells to General, what do you see?
 
Upvote 0
Thank Fluff for your quick response. To answer your question I do see that those dates that are exclusive and don't change, like for example New Year's and Christmas, they still appear in the format mm/dd/yyyy as the picture shows. But, those holidays that do change like Thanksgiving which is the 4th Thursday of November of whatever year or Labor Day and/or Memorial day that are 1st and Last Monday of the month respectively are calculated by means of the weekday(date(Y,M,1)) formulas. The biggest issue that I am having is that with all the other dates, I had no problems yet this issue is only with the Xmas date and I can't figure out why?


Book1
FGHI
2
3HOLIDAY# VALUE
41/1/2023
544942
644977
745075
86/19/2023
97/4/2023
1045173
1145208
124525345253
1312/25/202345285
14
Sheet1
 
Upvote 0
Those values that look like a date are text which is why the formula doesn't work. You need to change them to proper dates.
 
Upvote 0
Solution
Awesome suggestion..... dang, something as that actually brought back my blood pressure to normal lol! That did the job! Thank you again @Fluff!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top