How do I return "leave cell blank" using IF logic.

  • Thread starter Thread starter tlm1tlm
  • Start date Start date
T

tlm1tlm

=IF(ISBLANK(D40),NULL,TODAY()) does not work since NULL is not a function.
Tried many combinations but something is always returned when the cell is
blank. The column of cells are formated for date.
 
Maybe
=IF(ISBLANK(D40),"",TODAY())

Probably meets the OP's needs. That is, it certainly corrects the
OP's use of ISBLANK().

But caution: ironically, that does not "leave a cell blank", if by
that the OP means ISBLANK() would return true.

Let me clarify. Suppose A1 contains =if(isblank(B1),"",today()), and
suppose B1 is blank. A1 will __appear__ blank. But if A2 contains
=if(isblank(A1),"",today()), A2 will display TODAY() because A1 is not
"blank" in the sense that Excel uses the term. ("Blank" means empty
-- no formula or value.)

In my example, the following is more robust:

A1: =if(B1="", "", today())
A2: =if(A1="", "", today())

B1="" is true if B1 is empty (no formula or value) and if B1 contains
a null string (""), either the result of a formula like above or ="".

Note, however, that B1="" is __not__ true if B1 contains a string of
blanks (e.g. " "), even though that also appears "blank". For that,
you need:

=if(trim(B1)="", "", today())
 
You cannot have a truly blank cell if you have a formula in it

Excel does not recognize a Null value.

=IF(ISBLANK(D40),"",TODAY() is the closest you can come but is not blank.


Gord Dibben MS Excel MVP
 
Back
Top