IF(NOW()

R

RickLM

I need to select value from different cell depending on if NOW() is within
certain date rate ranges using:
IF(NOW() >=2/1/2008 OR <=2/29/2008,H4,IF(NOW() >=3/1/2008 OR
<=3/31/2008,I4,xxxRepeat IF for n of date rangesxxx)
OR
BETWEEN AND
or some other/better way
Date range may or may not be a complete moth and could be like 2/15/2008 and
3/28/2008
Thanks
 
P

Peter T

I don't understand exactly what you want from your If/Or/Between function,
but when using dates in such a formula do it like this -

Date(yyyy,m,d)

Also,although not incorrect you could use the TODAY function instead of NOW

eg
=TODAY()=DATE(2008,2,5)

Enter the year in full as above unless you want 1908

Regards,
Peter T
 
D

Dude Ranch

Hi Rick

A method I have used involves use the Vlookup function.
This LAST parameter is the trick here, if you set it to TRUE (or blank) then
the Vlookup stops at (or the next record after) the lookup cell. The key is
your look up cell Must be numerical (or alphabetical Order)

A B
1 10/01/2008 Dogs
2 20/01/2008 Cats
3 14/02/2008 Pigs

=Vlookup(Now(), $A$1:$B$3,2,True)

will return For Now() or Today() =

10/01/2008 Dogs
15/01/2008 Dogs
31/01/2008 Cats
15/02/2008 Pigs

I hope that Helps

Enjoy
Aloha
Jeff
 
R

RickLM

Thx Peter for reply... what I was trying to show was some ways that I thought
could be used to have a set date range and compare that range to NOW().
I know just enough about VBA to get started but when it comes to the finer
points I get stuck.
As I said what I want to do is select a valve from a cell if NOW() is within
stated date range.
Hope I have cleared up some of your Qs I don't really care if I use
BETWEEN/AND or some other method. I would like to use nested "IF" statements.
Thx again
 
D

Dave D-C

[sorry for replying to you Peter,
I lost the original post]

I think you want the IF/AND/OR/BUT/NOT syntax?
IF(OR(NOW()>="2/1/2008",NOW()<="2/29/2008",H4,IF(OR( etc.
 
D

Dave D-C

Correction on ()s.
It's OR(cond1,cond2)
IF(OR(NOW()>="2/1/2008",NOW()<="2/29/2008"),H4,IF(OR( etc.

Dave D-C said:
[sorry for replying to you Peter,
I lost the original post]

I think you want the IF/AND/OR/BUT/NOT syntax?
IF(OR(NOW()>="2/1/2008",NOW()<="2/29/2008"),H4,IF(OR( etc.
 
R

RickLM

Dave D-C
Thanks for the help it works great... but then you knew it would.
Thx again
--
RickLM


Dave D-C said:
Correction on ()s.
It's OR(cond1,cond2)
IF(OR(NOW()>="2/1/2008",NOW()<="2/29/2008"),H4,IF(OR( etc.

Dave D-C said:
[sorry for replying to you Peter,
I lost the original post]

I think you want the IF/AND/OR/BUT/NOT syntax?
IF(OR(NOW()>="2/1/2008",NOW()<="2/29/2008"),H4,IF(OR( etc.
I need to select value from different cell depending on if NOW() is within
certain date rate ranges using:
IF(NOW() >=2/1/2008 OR <=2/29/2008,H4,IF(NOW() >=3/1/2008 OR
<=3/31/2008,I4,xxxRepeat IF for n of date rangesxxx)
OR
BETWEEN AND
or some other/better way
Date range may or may not be a complete moth and could be like 2/15/2008
and
3/28/2008
Thanks
 

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