Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

3,283 views
Skip to first unread message

tlm1tlm

unread,
Apr 8, 2008, 1:51:02 PM4/8/08
to
=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.

Mike H

unread,
Apr 8, 2008, 1:57:04 PM4/8/08
to
Maybe

=IF(ISBLANK(D40),"",TODAY())

Mike

joeu2004

unread,
Apr 8, 2008, 6:03:10 PM4/8/08
to
On Apr 8, 10:57 am, Mike H <Mi...@discussions.microsoft.com> wrote:
> 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())

Gord Dibben

unread,
Apr 8, 2008, 6:20:24 PM4/8/08
to
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

On Tue, 8 Apr 2008 10:51:02 -0700, tlm1tlm <tlm...@discussions.microsoft.com>
wrote:

0 new messages