简体   繁体   中英

ISBLANK returns False for empty cells having Formulas

In Excel 2016, a cell with formula which is not yet calculated appears blank. But still ISBLANK returns False.

I am trying to find a way to return True for the cell having formula which is not yet calculated and is actually Blank.

Can someone help me please.

Thanks in Advance

In case anyone else is having trouble with this, I found a solution.

If a formula returns an empty string, you can't use ISBLANK() because the presence of the formula makes the cell not functionally blank, even if it is visually blank.

But, you can use IF() and LEN() to test how many characters are in the cell. LEN() is a function that counts the number of characters present in a cell. A visually blank cell will have no characters to count.

=IF(LEN(A1)=0, "This cell is blank", "This cell contains characters")

As per previous comments, ISBLANK will return FALSE even if your formula in cell C1 returns an empty string (""). ISBLANK will return TRUE only when a given cell is "truly" blank, ie does not contain any formulas or values.

As an alternative, try the following functions:

=C1="" <- will return TRUE, assuming that formula in C1 returns an empty string ("")

=OR(ISBLANK(C1),C1="") <- both formulas combined; will also work in case you remove your original formula from cell C1

=NOT(ISNUMBER(C1)) <- will return TRUE in case the result of your numeric formula is empty (eg =IF(LEN(A1),A1+B1,""))

One more formula that you may find useful:

=ISFORMULA(C1)

Hope it helps.

Use

=IF(A1="",""[VALUE IF TRUE],[VALUE OR A FUNCTION WHEN CONDITION IS FALSE]) 

instead of isblank because sometimes it assumes a zero matrix that is there in cell A1.

There are cases where a cell can possible contains one or more whitespaces, causing LEN() to fail. Use trim() combined with len() to overcome this issue, IF whitespace can be considered as a blank cell to you:

=IF(LEN(TRIM(A2))=0,TRUE,FALSE)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM