IF statement


Posted by Scott Holmes on September 25, 2001 10:55 AM

I have an IF statement similar to the following: =IF(B2>0,B2+C1,""). What I need is a better false statement that will leave the cell completely blank if the true condition is not met. This formula puts a blank space in the cell which is causing other problems.

thanks

Posted by Aladin Akyurek on September 25, 2001 11:05 AM

What problems? (NT)

Posted by Mark W. on September 25, 2001 11:08 AM

> ...I need...a...statement that will leave the
> cell...blank...

Not possible. All formulas return a value --
even if it's the null string ("") that you're
currently using. What "other problems" are
you experiencing?

Posted by Scott-Holmes on September 25, 2001 11:12 AM

Re: What problems? (NT)

My problem is that another formula used on the spreadsheet references this formula. The "" in the IF statement causes my subsequent formula to have an error (#value). Hope this clarifies my issue. thanks

Posted by Aladin Akyurek on September 25, 2001 11:18 AM

Re: What problems? (NT)

Scott --

The formulas that look at the result of =IF(B2>0,B2+C1,"") can test this cell with ISBLANK, e.g.,

=IF(ISBLANK(the-cell-of-the-first-formula),"",the-other-formula)


Aladin

Posted by Mark W. on September 25, 2001 11:22 AM

What's your subsequent formula? (nt)

thanks

Posted by Scott-Holmes on September 25, 2001 11:48 AM

Re: What problems? (NT)


Here is my scenario. I have a spreadsheet that I set up for users to input monthly totals in column A. I accumulate the monthly amounts in a running total column (column B). Column B contains the formula =IF(B2>0,B2+C1,""). My chart uses the data range in column B to generate a line graph. I want the chart to include an entire years worth of data points. The "" created in rows that do not have a monthly amount causes my graph line to drop to zero. Also, I subsequently take the results of the formula in column B and multipy it by another value in the spreadsheet which gives me a #value error. Even using the ISBLANK command I get the error message. I am sorry for such a long post. I really do appreciate you guys helping me figure this think out!!!


Posted by Aladin Akyurek on September 25, 2001 12:44 PM

Re: What problems?

> Here is my scenario. I have a spreadsheet that I set up for users to input monthly totals in column A. I accumulate the monthly amounts in a running total column (column B). Column B contains the formula =IF(B2>0,B2+C1,"").

Now I'm confused by this formula, because I can't fit it to to the situation you describe: It doesn't refer to cells in A and it refers to C1!

> My chart uses the data range in column B to generate a line graph. I want the chart to include an entire years worth of data points. The "" created in rows that do not have a monthly amount causes my graph line to drop to zero. Also, I subsequently take the results of the formula in column B and multipy it by another value in the spreadsheet which gives me a #value error. Even using the ISBLANK command I get the error message. I am sorry for such a long post. I really do appreciate you guys helping me figure this think out!!!

Let's try the following to get a clear picture:

In A1 enter: 1
In A2 enter: =IF(A1,10,"")
In A3 enter: =IF(A1,10,#N/A)

Subsequent formulas:

In B2 enter: =IF(ISNUMBER(A2),A2*2,"")
In B3 enter: =IF(ISNUMBER(A3),A2*2,"")

See what happens if you delete the value in A1.

Note. I expressly selected #N/A as a return value in A3, because this value seems better suited than "" if you need to make charts.

Aladin




Posted by Scott Holmes on September 25, 2001 12:59 PM

Re: What problems?

Aladin,

Thanks for your help. I appologize for referencing the wrong column in my last post and confusing you. Your explantion answered my problem. Using the #N/A is the correct command to use for the false statement. Once again thank you very much!!!

vr
Scott