IF DATE Multiple conditions [Solved/Closed]

Posts
3
Registration date
Wednesday March 26, 2014
Last seen
March 27, 2014
- - Latest reply: beejive
Posts
3
Registration date
Wednesday March 26, 2014
Last seen
March 27, 2014
- Mar 27, 2014 at 12:07 AM
Hello,

I need help with rewriting this code:
=IF(A1<DATE(2015,12,31), "3", IF(A1>DATE(2017,12,31),"2", IF(A1>DATE(2020,12,31), "1")))

I'm trying to categorize those date cutoffs into 3 as such:
2015 is 3
2017 is 2
2020 is 1

but apparently, the last category does not go into effect because of the first 2 conditions. So everything after date 2020 is still categorize as 2.

Does anyone know a way to categorize these date cutoffs into 3?

Thanks in advance!

See more 

1 reply

Best answer
Posts
19516
Registration date
Wednesday October 8, 2008
Status
Moderator
Last seen
December 12, 2018
1
Thank you
I suggest you change the order you are checking the dates. 2020, 2017 then 2015.

=IF(A1>DATE(2020,12,31), "1", IF(A1>DATE(2017,12,31),"2", IF(A1<DATE(2015,12,31), "3")))

Any date > 2020 is also > 2017

Thank you, xpcman 1

A few words of thanks would be greatly appreciated. Add comment

CCM has helped 2653 users this month

beejive
Posts
3
Registration date
Wednesday March 26, 2014
Last seen
March 27, 2014
-
That worked! Thank you.