Returning a blank cell (if statement)

D

Dave Peterson

You can't get a blank cell--it'll contain the formula itself.

But you could make it look like it's blank:

=if(a1>7,"ok","")
 
M

M. lane

Dan said:
If the criteria is not met using the IF function, how do I get a blank
cell?

The way to get excel to perform no action within a formula is with empty
quotation marks.
This gives the appearance of a blank cell.
Likewise a formula to test cell A1 to see if the number 5 was there, post
the word yes if it were, and do nothing if it were not would look like this:

=IF(A1=5,"YES","")

Notice the empty quotes at the end of the formula.
Now, you could remove the word yes leaving empty quotes, and instead place
the word no in the empty quotes at the end of the formula and it would post
NO until the number 5 was present in cell A1.
 
J

Jerry W. Lewis

Nothing behaves exactly like a blank cell except a blank cell, and as
has already been noted, a cell that contains a formula is not blank.

"" looks and sort of acts like a blank with many range functions (SUM,
AVERAGE, STDEV, etc) but generates an error with many other formulas.

#N/A sort of acts like a blank with some graphs, but but does not cause
a break in a line if there is data on both sides.

Until MS adds a true missing value (don't hold your breath) the only way
to get a cell to act exactly like a blank cell in all cases is to delete
the formula. Deletion and restoration of the formula could be automated
by a change-event macro if the workbook is often updated.

Jerry
 

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