ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I return "leave cell blank" using IF logic. (https://www.excelbanter.com/excel-worksheet-functions/182975-how-do-i-return-leave-cell-blank-using-if-logic.html)

tlm1tlm

How do I return "leave cell blank" using IF logic.
 
=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

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

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

Mike

"tlm1tlm" wrote:

=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.


joeu2004

How do I return "leave cell blank" using IF logic.
 
On Apr 8, 10:57*am, Mike H 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

How do I return "leave cell blank" using IF logic.
 
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
wrote:

=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.




All times are GMT +1. The time now is 11:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com