If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Odd Excel quirk?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-28-07, 13:43
RedNeckGeek RedNeckGeek is offline
Village Idiot
 
Join Date: Jul 2003
Location: Michigan
Posts: 1,941
Odd Excel quirk?

I have OfficeXP.

While helping a coworker develop a formula, I noticed that COUNTBLANK and ISBLANK treat "" in different manners.

COUNTBLANK will count "" as blank, while ISBLANK("")=False

Seems kind of inconsistent to me.
__________________
Inspiration Through Fermentation
Reply With Quote
  #2 (permalink)  
Old 02-28-07, 15:48
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Actually not inconsistent, because one COUNTBLANK is an integer value and "" in the cell equates to 0. The other ISBLANK is Boolean looking at the contents of the cell, and in this case you have two characters " and " in the cell.
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #3 (permalink)  
Old 02-28-07, 16:04
RedNeckGeek RedNeckGeek is offline
Village Idiot
 
Join Date: Jul 2003
Location: Michigan
Posts: 1,941
Quote:
Originally Posted by shades
Actually not inconsistent, because one COUNTBLANK is an integer value and "" in the cell equates to 0. The other ISBLANK is Boolean looking at the contents of the cell, and in this case you have two characters " and " in the cell.
But if "" = 0 then I still see it as ISBLANK(0)=FALSE

If I put in the following:

A1 = BLANK
A2 = ""
A3 = 0
A4 = COUNTBLANK(A1:A3) = 2
B1 = IF(ISBLANK(A1),1,0) = 1
B2 = IF(ISBLANK(A2),1,0) = 0
B3 = IF(ISBLANK(A3),1,0) = 0
B4 = SUM(B1:B3) = 1

I just would expect COUNTBLANK(A1:A3) to be the same as
(PSUEDO) - SUM(IF(ISBLANK(Ax),1,0)
__________________
Inspiration Through Fermentation
Reply With Quote
  #4 (permalink)  
Old 02-28-07, 16:26
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Using your setup, the result of this formula in XL is 1, not 2

=COUNTBLANK(A1:A3)

And really for the ISBLANK formulas ( =ISBLANK(A1) ) the result is

TRUE
FALSE
FALSE

(since they are Boolean formulas)
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #5 (permalink)  
Old 02-28-07, 16:31
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Okay, for your second cell (A2), you are putting in

=""

not

""

Therefore, it does evaluate to 2, which confirms my first post.
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #6 (permalink)  
Old 02-28-07, 16:42
RedNeckGeek RedNeckGeek is offline
Village Idiot
 
Join Date: Jul 2003
Location: Michigan
Posts: 1,941
I understand (and take) your point. It's just that, even though there are 2 functions in Excel containing "BLANK", blank means different things to each formula.

BTW:.... "old, slow... but at least I'm inconsistent."

Better to be old and inconsistent than old and incontinent!
__________________
Inspiration Through Fermentation
Reply With Quote
  #7 (permalink)  
Old 02-28-07, 22:40
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Quote:
Originally Posted by RedNeckGeek
I understand (and take) your point. It's just that, even though there are 2 functions in Excel containing "BLANK", blank means different things to each formula.
Actually it means the same thing to both, but the result of each formula is different...

Quote:
BTW:.... "old, slow... but at least I'm inconsistent."

Better to be old and inconsistent than old and incontinent!
So true. On one msg bd I didn't spell check before putting up my signature, and I spelled it that way. Needless to say I caught it and changed it, so it didn't stay long - someone would have had to have been quick on the draw and visited my post in a very short time span. But.... I almost became incontinent thinking about it staying that way!
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On