ISBLANK or what?

X

xpnovice

Hi,

In creating items such as invoices with pre-set formula and functions blank
cells often cause a #Value error.
To overcome this I use a basic IF statement such as =IF(B9="","",E20*E28)
or I may use the ISBLANK function such as =IF(ISBLANK(B9),"",E20*E28)). As
far as I can see, both are effective and work okay, although the 2nd option
(with ISBLANK) is a more compact formula. My question is simply, is there a
"correct" one between these 2 options, or will both work in all
circumstances. (As I said they work for me, at the moment with the formulas
I currently work on, but would one be better than the other for say more
complicated formulae that may arise in the future.)

Thanks
 
H

Harald Staff

If B9 contains a formula that under conditions returns an empty string, like
=IF(A9>10,A9,"")
then B9="" returns TRUE, while ISBLANK(B9) returns FALSE. So which to choose
depends on what you want done.

HTH. Best wishes Harald
Excel MVP
Followup to newsgroup only please
 
A

Alan Beban

Cells may "contain" empty blanks [i.e., there is nothing in the cell] or
string blanks [e.g., "", ',Left("A",0)]. ISBLANK returns TRUE only for
empty blanks; ="" returns true for either empty blanks or string blanks.
COUNTBLANK(rng) will return the number of empty blanks and string blanks
combined, as will COUNTIF(rng,""); COUNTIF(rng,"=" will return the
number of empty blanks.

Alan Beban
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top