IF function with dates

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)
 
B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top