date range in an if then statement

G

Guest

I have date ranges that certain things happen on. I need a formula that can
read a cell and determine if it's in betweeen August 16 and November 15, for
example, and return a value if it's true. I'm not sure how to get it to
work.

Thanks
 
P

Peo Sjoblom

August 16 what year, please provide as much info as possible when you ask a
question, I will assume the year is 2007, if not by looking at the formula
you should be able to adjust it. Also between does that include Aug 16, Nov
15, if not replace <= and >= with < and >

=IF(A2="","",IF(AND(A2>=DATE(2007,8,16),A2<=DATE(2007,11,15)),"Between","Not
between"))
 
G

Guest

Assuming your date is in cell A1 this formula will return true or false...

=AND(A1>=DATE(2007,8,16),A1<=DATE(2007,11,15))
 
G

Guest

Try something like the following:

=IF(AND(B2>=DATE(2007,8,16),B2<=DATE(2007,11,16)),TRUE,FALSE)

The formula compares the value in cell B2 to see if it falls between the 2
dates specified. The syntax for DATE is DATE(year,month,day) and the AND
function lets you state the date range.
 
G

Guest

Thanks for all the help!!

Peo Sjoblom said:
August 16 what year, please provide as much info as possible when you ask a
question, I will assume the year is 2007, if not by looking at the formula
you should be able to adjust it. Also between does that include Aug 16, Nov
15, if not replace <= and >= with < and >

=IF(A2="","",IF(AND(A2>=DATE(2007,8,16),A2<=DATE(2007,11,15)),"Between","Not
between"))
 

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