if between dates

M

Michelle

I am stumped.

I need to have a cell that returns one number if between
one set of dates and a different number if between
another set of dates.

For example. If MainCell is between date1cell and
date2cell then ratecell but if it is between date3cell
and date4cell then ratecell2.

This is for a rate chart for a hotel.

Thanks in advance for your help!
 
F

Frank Kabel

Hi
try something like
=IF(AND(maincell>=date1cell,maincell<=date2cell),ratecell2,IF(AND(mainc
ell>=date3cell,maincell<=date4cell),ratecell2,"no rate available"))
 
A

A.W.J. Ales

Michelle,

=IF(AND(Entry>=Date1,Entry<=Date2),1,IF(AND(Entry>=Date3,Entry<=Date4),2,"un
defined"))

Hereby is Entry the cell in which you input your date. Note however that
you didn't specify what the number should be if your entry isn't in one of
the two periods (Date1 , Date 2) and (Date3 , Date4).
In the formula you get a result "undefined" back for such a date.

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *
 

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