IF DATE Multiple conditions [Solved/Closed]

beejive 3 Posts Wednesday March 26, 2014Registration date March 27, 2014 Last seen - Mar 26, 2014 at 10:25 AM - Latest reply: beejive 3 Posts Wednesday March 26, 2014Registration date March 27, 2014 Last seen
- 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 

2 replies

Best answer
xpcman 19100 Posts Wednesday October 8, 2008Registration dateModeratorStatus July 16, 2018 Last seen - Mar 26, 2014 at 08:15 PM
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

Something to say? Add comment

CCM has helped 1712 users this month

beejive 3 Posts Wednesday March 26, 2014Registration date March 27, 2014 Last seen - Mar 27, 2014 at 12:07 AM
That worked! Thank you.