Can IF function produce a blank cell?

A

agbiggs

I'm using the IF function to create a column of data which will be
charted. If the IF criterion isn't satisfied, I'd like it to output a
blank cell, rather than a zero or some other number, so it won't be
charted. Is there any way to do this? Thanks,

Andrew
 
G

Guest

Hi

You could use a space or #N/A in your formula:

=IF(A2<0," ",A2)
=IF(A2<0,"#N/A",A2)

They both seem to work for me.

Andy
 
B

Bernard Liengme

People must have had a heavy weekend.
Niek's =IF(YourCondition,YourValue,=NA()) should read
=IF(YourCondition,YourValue,NA())
and Andy's =IF(A2<0,"#N/A",A2) should be =IF(A2<0,#N/A,A2)

I thought I was the only one prone to typos!
best wishes
 
B

Bernard Liengme

Also be advised that =IF(A2<0,"",A2) in B1 will give a value of FALSE if you
then use =ISBLANK(B1). This is because a formula is not a blank even when
the cell looks blank.
 
N

Niek Otten

Thanks, Bernard.

I "always" test a formula.
The very few occasions that I don't usually get me on the right track again!
 
Top