Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If statement

Status
Not open for further replies.

jlg5454

Technical User
Jan 6, 2005
98
US
I need a formula to first look at a cell in column A and to decide if it is greater than today's date to place a null value in the cell right off the bat other wise continue on with the formula. Example which does not work:

=IF((A35>TODAY()),"",IF((ISERROR(VLOOKUP(A35,Date,3,FALSE))),0,VLOOKUP(A35,Date,3,FALSE)))

Thanks for any help you can provide.

Joe
 




Hi,

Do the individual parts calculate???
[tt]
=VLOOKUP(A35,Date,3,FALSE)
=IF((ISERROR(VLOOKUP(A35,Date,3,FALSE))),0,VLOOKUP(A35,Date,3,FALSE))
[/tt]
BTW, I would recommend NOT using a named range like DATE, which is often a reserve word. Maybe something like DateRang instead.

Skip,

[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue]
 



BTW, a QUICK way to determine if expressions within a larger expression are cancluating correctly...

select an expression within a larger expression and hit F9.

Skip,

[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue]
 
Other than some extra parentheses, which aren't hurting anything, I don't see any problem with your formula.

What happens or doesn't happen that is different than your expectation?

Just to take a WAG, try to change the format of A35 and the first column of the named range "Date" - does the display change? If not, you have text in that cell rather than an actual date.

Also, I agree with Skip that you should rename your range.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
What I'm looking to do is if the date from the first column is greater than today's date make cell null otherwise fill in the cell with appropriate data.

Thanks
 
Oh. you mean NULL null, don't you? As in delete the formula that you are using to do the calculation?

You can't do that with a formula. The formula can return a "zero length string" so that it doesn't display anything in the cell - that's what you are doing now.

But a worksheet function can't just - *poof* - make itself disappear. And even if could, I assume that you'll want the formula to become active again should the value in A should change.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
IS A35 an actual date or text?

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top