Excel If Function over a range of dates

January 2017




Issue


Can anyone help please? I am trying to add a division's column, which are taken from a date range in another column. I.e. I would like to add "Scb", years 1994-1995, "J" 1996-1997, "Y" 1998-1999 and "E" over 1999. Is there anyway I can do this? Any help would be appreciated. Thank you

Solution


Suppose your values are in Cell A2 then put this formula in Cell B2 and drag it down

B2==IF(AND(YEAR(A2)>=1994,YEAR(A2)<=1995),"SCb",IF(AND(YEAR(A2)>=1996,YEAR(A2)<=1997),"J",IF(AND(YEAR(A2)>=1998,YEAR(A2)<=1999),"Y",IF(YEAR(A2)>1999,"E"))))

Note


Thanks to mubashir aziz for this tip on the forum.

Related


Published by aakai1056. Latest update on February 16, 2010 at 07:44 AM by aakai1056.
This document, titled "Excel If Function over a range of dates," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).