Excel dates Problem

B

brett4098

What I am trying to do is return a certain value in a cell if the value
of a different cell is within a one month range. I am currently trying
to use the IF function, but it isn't working out.
Ex. IF A1 is between 1/1/2004 and 1/31/2004 then return A2.
 
N

Norman Harker

Hi Brett!

No need to post to different groups.

Over in worksheet function you had three replies with 6 suggestions
from Peo Sjoblom, Daniel M and me.

=IF(AND(A1>=DATE(2004,1,1),A1<=DATE(2004,1,31)),A2,"")

=IF(AND(MONTH(A1)=1,YEAR(A1)=2004),A2,"")

=IF(AND(A1>=DATE(2004,1,1),A1<DATE(2004,2,1)),A2,"")

=IF(A1-DAY(A1)=DATE(2004,1,0),A2,"")

=IF(AND(A1>=--"01/01/04",A1<=--"01/31/04"),A2,"")

=IF(AND(YEAR(A1)=2004,MONTH(A1)=1),A2,"")

Method 5 will fail unless you have US date settings.


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 

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