Help to resolve IF function for excel

Copper Contributor

Hi all,

I have a date cell A1=Apr-24
I input this formula =IF(A1<=DATE(YEAR(TODAY()),12,31),Condition1,Condition2)
Will does this formula not mean if A1 is within this year, Condition1 should be fulfilled?
I got Condition2 result returned to me.

1 Reply

@prickyprickl35 That formula will return Condition1 for any date in A1 that is on or before the end of the current year. Not only within this year. Also dates from last year or ten years ago. Anything else returns Condition2.

Assuming "Apr-24" is a real date (i.e. a proper date value), merely formatted to be shown as Mmm-yy, then Condition2 would be correct as it is after Dec 31, 2021.

 

If A1 contains a text that looks like a date Mmm-yy, you will always get Condition2 as a text is considered greater than a number. And real dates in Excel are in fact numbers.