Excel assigns the value 0 to a blank cell (Excel: why the value of a blank cell is zero?). The ISBLANK
functions checks the contents.
But:
Let's consider A1
is empty. B2
is =A1&"foo"
. B2 results to "foo" and not to "0foo". why?
Excel assigns the value 0 to a blank cell (Excel: why the value of a blank cell is zero?). The ISBLANK
functions checks the contents.
But:
Let's consider A1
is empty. B2
is =A1&"foo"
. B2 results to "foo" and not to "0foo". why?
Excel will use the default empty variable value as the value of the empty cell depending on how you are trying to access it.
If you are using it as a numerical value, excel will use the default value for empty Integer
, Double
, etc., which is 0.
If you are using it as a string, like when you concatenate with ="foo" & A1
, it will use String
default empty value, which is ""
. So "foo" & ""
is just "foo"
.
See here for a better explanation.
Because =ISBLANK()
and =0
are not the same thing.
A cell will return true to ISBLANK if it does not have any contents set.
A cell will return 0 if it contains a value of 0, or if it contains a value that evaluates to 0, or if it contains a string that evaluates to 0, or if you try to perform an equation with a blank cell. Equations need numbers, and if an equation is performed on something that is blank then it has the same effect as using 0.