IF function with dates

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

Hello everyone,

I'm having some problems with a formula that should be
simple so I'm hoping someone can help me out. What I'm
trying to do in cell B2 is have Excel look at the date of
a class taken (in cell D1) and if that class was taken in
calendar 2003, input the credits into cell B2. Likewise,
if the class was taken in calendar 2002, I'd then want
the credits in the 2002 column (in this case, in cell
A2). Right now, I'm getting zeros with the formula I have
in B2. Thanks in advance for your help.

Cell A1: 1/1/2002 (date format)
Cell B1: 1/1/2003 (date format)
Cell C1: 1/1/2004 (date format)
Cell D1: Date of class (date format)
Cell E1: Class Credits (number format)

Cell A2: =IF(D1<B1,D1,0) (general format)
Cell B2: =IF(A1<D1<C1,D1,0) (general format)
Cell C2: =IF(D1>C1,D1,0) (general format)
 
Scott,

Try
A2: =IF(YEAR(D1)=2002,E1,"")
B2: =IF(YEAR(D1)=2003,E1,"")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top