IF DATE Multiple conditions

Solved/Closed
beejive Posts 2 Registration date Wednesday March 26, 2014 Status Member Last seen March 27, 2014 - Mar 26, 2014 at 10:25 AM
beejive Posts 2 Registration date Wednesday March 26, 2014 Status Member 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!

1 response

xpcman Posts 19530 Registration date Wednesday October 8, 2008 Status Contributor Last seen June 15, 2019 1,827
Mar 26, 2014 at 08:15 PM
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
1
beejive Posts 2 Registration date Wednesday March 26, 2014 Status Member Last seen March 27, 2014
Mar 27, 2014 at 12:07 AM
That worked! Thank you.
0