If, then with blanks

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using an If, then statement how can I test for a blank cell? Sometimes there will be numeric info, sometimes text, sometimes blank. I want the test to either return a blank cell or the info in the cell. How do I test for no data at all?
Thanks in advance!
Dani
 
Hi Dani
one way
=IF(A1="","",A1)

another way
=IF(ISBLANK(A1),"",A1)
though this won't work if A1 has been filled by a formula with the
value ""

HTH
Frank
 
=IF(ISBLANK(A1),---,---)

HTH
Jason
Atlanta, GA
-----Original Message-----
Using an If, then statement how can I test for a blank
cell? Sometimes there will be numeric info, sometimes
text, sometimes blank. I want the test to either return a
blank cell or the info in the cell. How do I test for no
data at all?
 
Try open quote,close quote as criteria
Example. =IF(A1="","",A1
If the cell is blank, a blank will be returne
else the contents A1 will be returned regardles
of type of inf
 
Frank Kabel said:
Hi Dani
one way
=IF(A1="","",A1)

another way
=IF(ISBLANK(A1),"",A1)
though this won't work if A1 has been filled by a formula with the
value ""
Wishlist item:

This brings me back to and old argument. Excel is very sloppy with the
notions of blank and empty. Here, "" means an empty string in a cell that is
not empty because it has an empty string recorded in it. I wish you could
write the property "empty" to a cell, and test for this.

Regards
 
...
This brings me back to and old argument. Excel is very sloppy with the
notions of blank and empty. Here, "" means an empty string in a cell that is
not empty because it has an empty string recorded in it. I wish you could
write the property "empty" to a cell, and test for this.

The notion of 'blank' is mostly well-defined: cells containing nothing at all,
not even ="" or a single apostrophe. Whether some people misuse blank to mean
something more generic like cells containing nothing *visible* is hardly
Microsoft's fault or problem. As for the term 'empty', it's used in VBA, and
confusingly the value of blank cells is Empty in VBA, but in Excel proper the
term 'empty' isn't used in Excel's documentation (online help). Again, if some
people use 'empty' to mean something with respect to cell contents or values,
since Microsoft hasn't promulgated the term, it's (mis)use is hardly their
responsibility.

That said, Microsoft does have something to answer for when it comes to
COUNTBLANK, in which they blur the meaning of 'blank'.

So, is there a single test for "" that would exclude blank cells? No, but
there's no single test for numeric 0 that would exclude blanks cells either.
 
Back
Top