what is syntax for if(between range of dates,"Q1","Q2")?

G

Guest

HI,
I'm trying to create the following formula:

if cell b34 is between Nov 1/04 and Jan 31/05, enter "Q1"
if cell b34 is between Feb 1/05 and April 30/05, enter "Q2"

etc.
What is the correct syntax for this formula? I have entered:

if(11/01/04<=b34<=01/31/05,"Q1",if(02/01/05<=b34<=04/30/05,"Q2",if(etc etc)))

But this isn't working.

Does anyone know how to create an If statement based on a cell falling
within a range of dates?
 
G

Guest

Perfect, thank you.

Roger Govier said:
Hi

=IF(AND(B34>=DATE(2004,11,1),B34<=DATE(2005,1,31)),"Q1",IF(AND(B34>=DATE(2005,2,1),B34<=DATE(2005,4,30)),"Q2",""))

Regards

Roger Govier
 
R

Roger Govier

You are very welcome. Thanks for the feedback.

Also apologies to everyone, I just noticed my system date had gone haywire
and was reading the 6th. I have now come back to the present!!

Regards

Roger Govier
 
R

Roger Govier

Hi

=IF(AND(B34>=DATE(2004,11,1),B34<=DATE(2005,1,31)),"Q1",IF(AND(B34>=DATE(2005,2,1),B34<=DATE(2005,4,30)),"Q2",""))

Regards

Roger Govier
 

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