Date Question

A

Andrew Mackenzie

In row A I have dates 31-Jan-08, 28-Feb-08, 31-Mar-08...etc.

In row B I want an =IF function such that a certain formula will apply if
the date is 31st December, regardless of the year.

Can anyone tell me how to refer to the date in such a funtion? i.e.
=IF(A1=?????,25*3,25*4) if A1 is 31-Dec-** then 25 times 3, otherwise 25
times 4.

Many thanks for any help

Andrew
 
A

Andrew Mackenzie

Thanks all for a comprehensuive and speedy reply (it was obviously easier
than I thought!).
 
B

Bob Phillips

=IF(AND(DAY(A1)=31,MONTH(A1)=12),25*3,25*4)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
D

Dave Peterson

One more:
=if(text(a1,"mmdd")="1231",25*3,25*4)

and another:
=25*(4-(TEXT(A1,"mmdd")="1231"))

This portion:
(TEXT(A1,"mmdd")="1231")
will return true or false. But when excel subtracts it from 4, it'll see
true/false as 1 or 0.
 

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