IF calculation using dates - brain hurts

T

Theo

I have a date range:
From:8/5/2009
To: 11/19/2009

I have Month/Year Column and then a Result Column; in the Result Column I
need a formula that will determine if the month and year is within the above
date range.
Jul 09 Formula should return No
Aug 09 Formula should return Yes

Any suggestions?
Thanks
T
 
D

Don Guillett

Where f13 is the from date and f14 is the to date and f15 is the date to
check.
=IF(AND(F15>$F$13,F15<=$F$14),"Yes","No")
 
T

Theo

It doesn't work because the from Date is 8/4/2009 and the date I'm checking
is Aug-2009 (which Excel is reading as 8/1/2009).
Somehow I need the check to be against just the month and year, but I can't
figure out how to do that. OR I need to do some type of LOOKUP where Aug
2009 is a series of dates between 8-1 and 8-31 and the from date just has to
be one of them. But I'm struggling with that one too.
Thanks Don
 
J

JoeU2004

Theo said:
It doesn't work because the from Date is 8/4/2009 and the date
I'm checking is Aug-2009 (which Excel is reading as 8/1/2009).
Somehow I need the check to be against just the month and year,
but I can't figure out how to do that.

Assuming you are looking for an Excel formula solution, not VBA, one
approach is:

=if(date(year(A1),month(A1),1) = date(year(A2),month(A2),1),"same
month/year","not same month/year")

Note: You can avoid one of the DATE functions if you want to assume that
the cell is always mm/1/yyyy, as Aug-2009 is. In that case:

=if(A1 = date(year(A2),month(A2),1), "same...", "not same...")


----- original message -----
 

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