Excel If Function over a range of dates

November 2016




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 :

This document entitled « Excel If Function over a range of dates » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.