A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Count Blanks in a Filtered Column



 
 
Thread Tools Display Modes
  #11  
Old March 21st, 2006, 10:56 PM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Count Blanks in a Filtered Column

Hi!

There is a huge difference between an empty cell and a blank cell.

The "problem" arises when people use the 2 terms interchangeably. An empty
cell is one that contains nothing, nothing at all. A blank cell can contain
a formula that returns "nothing" so the cell is not empty, it contains a
formula but the cell appears to be empty.

Try this:

Enter this FORMULA in A1: =""

Try these formulas:

=ISBLANK(A1)
=COUNTBLANK(A1)
=COUNTA(A1)
=LEN(A1)

2 of those formulas might lead you to believe that cell A1 is empty and the
other 2 "indicate" that something's there.

Biff

"GaryE" wrote in message
...

This one really intrigues me. I am trying to figure out the difference
between a blank cell and an empty cell. A cell that has not been
touched in excel evaluates to zero. It will also evaluate to
ISBLANK(); TRUE. If I enter random data in a cell press return and
then delete that data the cell evaluates the same way.

This tells me that there is no difference between a blank cell and an
empty cell.

FWIW if you use the following formula to evaluate a cell you get the
#VALUE error.

=if(A1=(char(0)),true.false)

Char(0) is the ascii value for null (or blank if you prefer).

You even get the #VALUE error if you place the following formula in
cell A1
=char(0).

So as far as I can tell there is no difference between an Empty cell
and a blank cell. And Excel does not designate empty cells as ascii
character 0. And Excel treats an empty cell the same way as a the
number 0. To further expand on this I did the following.

Starting on a new untouched worksheet.

I put the following formulas in cells b1-d1 respectively and filled
down for 6 cells.

=IF(A1=0,1,0) =IF(ISNUMBER(A1),1,0) =IF(ISBLANK(A1),1,0) =IF(A1="0",1,0)

I put the following in cells A1-A6
nothing
=0
="0"
0
entered a number and then deleted
entered text and then deleted

the results of the formulas in cells B-E are
1 0 1 0
1 1 0 0
0 0 0 1
0 0 0 1
1 0 1 0
1 0 1 0

Don't know if this helps anyone but it was an interesting academic
excersize.


Gary

Biff Wrote:
Clarification:

That doesn't work.........


If the cells are EMPTY, it does work if the cells have formula BLANKS.

Don't know whether the OP meant "blank" or empty.

How would you count EMPTY cells? I haven't been able to figure it out.

Biff

"Biff" wrote in message
...
That doesn't work. Result = 0, unfiltered or filtered. I tried that
formula (along with many other variations) earlier.

Typo in the formula, one too many ")"

ROW(B5)),,1))

ROW(B5),,1))

Biff

"Aladin Akyurek" wrote in message
...
Assuming that the secret column range is B5:B200...


=SUMPRODUCT(SUBTOTAL(3,OFFSET(B5:B200,ROW(B5:B200)-ROW(B5)),,1)),--(B5:B200=""))

Gos-C wrote:
Hi,

Is there a function to count blanks in a filtered column? That is,

if
I filter a column to show the rows that are blank, can I use the
subtotal function (or some other) to count the number of blanks?

Thanks,
Gos-C




--
GaryE
Posted from - http://www.officehelp.in



  #12  
Old March 21st, 2006, 11:58 PM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Count Blanks in a Filtered Column

Biff wrote...
There is a huge difference between an empty cell and a blank cell.


So true.

The "problem" arises when people use the 2 terms interchangeably. An empty
cell is one that contains nothing, nothing at all. A blank cell can contain
a formula that returns "nothing" so the cell is not empty, it contains a
formula but the cell appears to be empty.


So wrong!

If X99 contained ="", does ISBLANK(X99) return TRUE or FALSE? If it
returns FALSE, why would you claim 'blank' means cells evaluating to
""?

In worksheet formulas, 'blank' has a precise meaning implied by the
ISBLANK function: the cell contains nothing. 'Empty' has no specified
meaning, so it's more naturally suited for use as meaning cells
containing zero length strings. Then there's the issue of cells
containing strings of nothing but one or more ASCII or HTML nonbreaking
spaces, which would also appear not to contain anything.

Try this:

Enter this FORMULA in A1: =""


And clear cell B1.

Try these formulas:

=ISBLANK(A1)


Indeed, do try this one. Then try

=ISBLANK(B1)

=COUNTBLANK(A1)


This is where Microsoft screwed up. It'll return 1, but so will

=COUNTBLANK(B1)

=COUNTA(A1)
=LEN(A1)

2 of those formulas might lead you to believe that cell A1 is empty and the
other 2 "indicate" that something's there.


ISBLANK and COUNTA are the reliable indicators. LEN is just doing it's
job. Since Excel converts blank cells (cells containing nothing) to ""
in string contexts, LEN correctly returns 0 when passed a reference to
a blank cell. It's COUNTBLANK that's flawed.

"GaryE" wrote in message

....
So as far as I can tell there is no difference between an Empty cell
and a blank cell. And Excel does not designate empty cells as ascii
character 0. And Excel treats an empty cell the same way as a the
number 0. To further expand on this I did the following.


Definitions are everything sometimes. What do you mean by 'empty'?

Also, just because C uses ASCII NUL as a string terminator, so zero
length strings in C would be represented in memory as a single NUL
byte, doesn't mean Excel or any other software or programming language
follows that approach. Indeed, Perl and gawk are two examples of
programming languages closely related to C that don't use ASCIIZ
strings. Strings can be implemented as structures or classes containing
at minimum a length property and a pointer to allocated memory used to
store the string. Such strings could store anything, including several
NUL bytes.

Starting on a new untouched worksheet.

I put the following formulas in cells b1-d1 respectively and filled
down for 6 cells.

=IF(A1=0,1,0) =IF(ISNUMBER(A1),1,0) =IF(ISBLANK(A1),1,0) =IF(A1="0",1,0)


There are 4 formulas here, so in B1:E1?

I put the following in cells A1-A6
nothing
=0
="0"
0
entered a number and then deleted
entered text and then deleted

the results of the formulas in cells B-E are
1 0 1 0
1 1 0 0
0 0 0 1
0 0 0 1
1 0 1 0
1 0 1 0

....

That the 5th and 6th rows are the same as the 1st after clearing A5 and
A6 should be no surprise. Clearing A5 and A6 makes those cells blank,
so they're the same as A1.

As for your 4th row, is the cell formatted as Text? Or are you
forgetting to mention an initial single quote? The numeric constant 0
should produce the same results as the formula =0, so B4:E4 should be
the same as B2:E2 rather than B3:E3.

  #13  
Old March 22nd, 2006, 12:09 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Count Blanks in a Filtered Column

Biff wrote...
....
How would you count EMPTY cells? I haven't been able to figure it out.

....

Presumably you mean cells containing nothing. If there were another
column in the filtered table that always contained something, then

=SUBTOTAL(3,OtherColumn)-SUBTOTAL(3,GivenColumn)

would count the number of cells in GivenColumn that contain nothing. As
for cells that contain things that evaluate to "", counting them
requires udfs.

  #14  
Old March 22nd, 2006, 02:36 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Count Blanks in a Filtered Column

=SUBTOTAL(3,OtherColumn)-SUBTOTAL(3,GivenColumn)

Doh!

Never even thought of that.

As for cells that contain things that evaluate to ""


Aladins formula seems to work for that. Lightly tested.

Biff

"Harlan Grove" wrote in message
oups.com...
Biff wrote...
...
How would you count EMPTY cells? I haven't been able to figure it out.

...

Presumably you mean cells containing nothing. If there were another
column in the filtered table that always contained something, then

=SUBTOTAL(3,OtherColumn)-SUBTOTAL(3,GivenColumn)

would count the number of cells in GivenColumn that contain nothing. As
for cells that contain things that evaluate to "", counting them
requires udfs.



  #15  
Old March 22nd, 2006, 02:48 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Count Blanks in a Filtered Column

you didn't read all of the posts : )

"Biff" wrote:

=SUBTOTAL(3,OtherColumn)-SUBTOTAL(3,GivenColumn)


Doh!

Never even thought of that.

As for cells that contain things that evaluate to ""


Aladins formula seems to work for that. Lightly tested.

Biff

"Harlan Grove" wrote in message
oups.com...
Biff wrote...
...
How would you count EMPTY cells? I haven't been able to figure it out.

...

Presumably you mean cells containing nothing. If there were another
column in the filtered table that always contained something, then

=SUBTOTAL(3,OtherColumn)-SUBTOTAL(3,GivenColumn)

would count the number of cells in GivenColumn that contain nothing. As
for cells that contain things that evaluate to "", counting them
requires udfs.




  #16  
Old March 22nd, 2006, 02:48 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Count Blanks in a Filtered Column

So wrong!

If X99 contained ="", does ISBLANK(X99) return TRUE or FALSE? If it
returns FALSE, why would you claim 'blank' means cells evaluating to
""?


What do mean "so wrong"?

Where did I claim blank means cells evaluating to ""?

A blank cell can contain
a formula that returns "nothing"


That's why "nothing" is quoted!

Biff

"Harlan Grove" wrote in message
oups.com...
Biff wrote...
There is a huge difference between an empty cell and a blank cell.


So true.

The "problem" arises when people use the 2 terms interchangeably. An empty
cell is one that contains nothing, nothing at all. A blank cell can
contain
a formula that returns "nothing" so the cell is not empty, it contains a
formula but the cell appears to be empty.


So wrong!

If X99 contained ="", does ISBLANK(X99) return TRUE or FALSE? If it
returns FALSE, why would you claim 'blank' means cells evaluating to
""?

In worksheet formulas, 'blank' has a precise meaning implied by the
ISBLANK function: the cell contains nothing. 'Empty' has no specified
meaning, so it's more naturally suited for use as meaning cells
containing zero length strings. Then there's the issue of cells
containing strings of nothing but one or more ASCII or HTML nonbreaking
spaces, which would also appear not to contain anything.

Try this:

Enter this FORMULA in A1: =""


And clear cell B1.

Try these formulas:

=ISBLANK(A1)


Indeed, do try this one. Then try

=ISBLANK(B1)

=COUNTBLANK(A1)


This is where Microsoft screwed up. It'll return 1, but so will

=COUNTBLANK(B1)

=COUNTA(A1)
=LEN(A1)

2 of those formulas might lead you to believe that cell A1 is empty and
the
other 2 "indicate" that something's there.


ISBLANK and COUNTA are the reliable indicators. LEN is just doing it's
job. Since Excel converts blank cells (cells containing nothing) to ""
in string contexts, LEN correctly returns 0 when passed a reference to
a blank cell. It's COUNTBLANK that's flawed.

"GaryE" wrote in message

...
So as far as I can tell there is no difference between an Empty cell
and a blank cell. And Excel does not designate empty cells as ascii
character 0. And Excel treats an empty cell the same way as a the
number 0. To further expand on this I did the following.


Definitions are everything sometimes. What do you mean by 'empty'?

Also, just because C uses ASCII NUL as a string terminator, so zero
length strings in C would be represented in memory as a single NUL
byte, doesn't mean Excel or any other software or programming language
follows that approach. Indeed, Perl and gawk are two examples of
programming languages closely related to C that don't use ASCIIZ
strings. Strings can be implemented as structures or classes containing
at minimum a length property and a pointer to allocated memory used to
store the string. Such strings could store anything, including several
NUL bytes.

Starting on a new untouched worksheet.

I put the following formulas in cells b1-d1 respectively and filled
down for 6 cells.

=IF(A1=0,1,0) =IF(ISNUMBER(A1),1,0) =IF(ISBLANK(A1),1,0) =IF(A1="0",1,0)


There are 4 formulas here, so in B1:E1?

I put the following in cells A1-A6
nothing
=0
="0"
0
entered a number and then deleted
entered text and then deleted

the results of the formulas in cells B-E are
1 0 1 0
1 1 0 0
0 0 0 1
0 0 0 1
1 0 1 0
1 0 1 0

...

That the 5th and 6th rows are the same as the 1st after clearing A5 and
A6 should be no surprise. Clearing A5 and A6 makes those cells blank,
so they're the same as A1.

As for your 4th row, is the cell formatted as Text? Or are you
forgetting to mention an initial single quote? The numeric constant 0
should produce the same results as the formula =0, so B4:E4 should be
the same as B2:E2 rather than B3:E3.



  #17  
Old March 22nd, 2006, 04:06 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Count Blanks in a Filtered Column

Biff wrote...
....
Where did I claim blank means cells evaluating to ""?

A blank cell can contain
a formula that returns "nothing"


That's why "nothing" is quoted!

....

You wrote: "The "problem" arises when people use the 2 terms
interchangeably. An empty cell is one that contains nothing, nothing at
all. A blank cell can contain a formula that returns "nothing" so the
cell is not empty, it contains a formula but the cell appears to be
empty."

You may have been imprecise in your definition of 'blank', but your
definition of 'empty' is the definition of 'blank' (in the ISBLANK
sense), so by stating that 'blank' means something else you're wrong.

Simple linguistics would imply most people would draw a correspondence
between 'blank' the state and ISBLANK the function. If so, 'blank'
means the state in which cells contain nothing (no quotes). Some other
term, perhaps 'empty', could be used to refer to cells with no visible
result (I tend to use 'visually blank').

  #18  
Old March 22nd, 2006, 04:45 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Count Blanks in a Filtered Column

you didn't read all of the posts : )

I did!

Never even thought of that.


I didn't think of it, you did!

I thought about selecting all the EMPTY cells and padding them with a
formula blank.

I just thought that there might be a formula that didn't "depend" on another
column of data being present.

Biff

"JMB" wrote in message
...
you didn't read all of the posts : )

"Biff" wrote:

=SUBTOTAL(3,OtherColumn)-SUBTOTAL(3,GivenColumn)


Doh!

Never even thought of that.

As for cells that contain things that evaluate to ""


Aladins formula seems to work for that. Lightly tested.

Biff

"Harlan Grove" wrote in message
oups.com...
Biff wrote...
...
How would you count EMPTY cells? I haven't been able to figure it out.
...

Presumably you mean cells containing nothing. If there were another
column in the filtered table that always contained something, then

=SUBTOTAL(3,OtherColumn)-SUBTOTAL(3,GivenColumn)

would count the number of cells in GivenColumn that contain nothing. As
for cells that contain things that evaluate to "", counting them
requires udfs.






  #19  
Old March 22nd, 2006, 05:25 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Count Blanks in a Filtered Column

I did!
My apologies.

I just thought that there might be a formula that didn't "depend" on another
column of data being present.


Yeah, but darned if I can figure out how to identify an empty cell (while
weeding out those that are not visible due to a filter) using a more direct
approach. I was hoping someone else would figure it out. Maybe after the
blank cell versus empty cell issue is resolved? g



"Biff" wrote:

you didn't read all of the posts : )


I did!

Never even thought of that.


I didn't think of it, you did!

I thought about selecting all the EMPTY cells and padding them with a
formula blank.

I just thought that there might be a formula that didn't "depend" on another
column of data being present.

Biff

"JMB" wrote in message
...
you didn't read all of the posts : )

"Biff" wrote:

=SUBTOTAL(3,OtherColumn)-SUBTOTAL(3,GivenColumn)

Doh!

Never even thought of that.

As for cells that contain things that evaluate to ""

Aladins formula seems to work for that. Lightly tested.

Biff

"Harlan Grove" wrote in message
oups.com...
Biff wrote...
...
How would you count EMPTY cells? I haven't been able to figure it out.
...

Presumably you mean cells containing nothing. If there were another
column in the filtered table that always contained something, then

=SUBTOTAL(3,OtherColumn)-SUBTOTAL(3,GivenColumn)

would count the number of cells in GivenColumn that contain nothing. As
for cells that contain things that evaluate to "", counting them
requires udfs.







  #20  
Old March 22nd, 2006, 05:49 AM posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: n/a
Default Count Blanks in a Filtered Column

Maybe add a new column to the table and enter

=--(Cell("type", CellRef)="b")

and copy it down. Then use Subtotal(9, RangeRef) to get a count. Cell
seems to distinguish between truly empty cells and those that appear empty.
Interestingly, it seems Microsoft is also confused on the terminology.
According to help, the CELL function:

"Returns "b" for blank if the cell is empty"

Couldn't get it to work in an array formula, so it's still a two step process.

"Biff" wrote:

you didn't read all of the posts : )


I did!

Never even thought of that.


I didn't think of it, you did!

I thought about selecting all the EMPTY cells and padding them with a
formula blank.

I just thought that there might be a formula that didn't "depend" on another
column of data being present.

Biff

"JMB" wrote in message
...
you didn't read all of the posts : )

"Biff" wrote:

=SUBTOTAL(3,OtherColumn)-SUBTOTAL(3,GivenColumn)

Doh!

Never even thought of that.

As for cells that contain things that evaluate to ""

Aladins formula seems to work for that. Lightly tested.

Biff

"Harlan Grove" wrote in message
oups.com...
Biff wrote...
...
How would you count EMPTY cells? I haven't been able to figure it out.
...

Presumably you mean cells containing nothing. If there were another
column in the filtered table that always contained something, then

=SUBTOTAL(3,OtherColumn)-SUBTOTAL(3,GivenColumn)

would count the number of cells in GivenColumn that contain nothing. As
for cells that contain things that evaluate to "", counting them
requires udfs.







 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to Improve Code Copying/Pasting Between Workbooks David General Discussion 1 January 6th, 2006 03:56 AM
Positioning Numeric Values Resulting from 6 Column Array Formula Sam via OfficeKB.com Worksheet Functions 2 January 5th, 2006 02:03 AM
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Worksheet Functions 8 May 18th, 2005 04:23 AM
IF COUNTIF & COUNTA on Filtered Visible Cells Tinä General Discussion 0 November 7th, 2004 08:28 PM
IF COUNTIF & COUNTA on Filtered Visible Cells Tinä General Discussion 0 November 3rd, 2004 08:43 PM


All times are GMT +1. The time now is 03:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.