Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Wayne
 
Posts: n/a
Default CountIF cells are not empty

How can I get the CountIf function to count the number of
cells in a range where the cells are not empty?

Typ cell contents...

1a
1b
2.1
2.2
(empty)
(empty)
3.2.2
3.2.2
-----
total cell count of non empty cells = 6
total number of cells in range = 8


regards

Wayne

  #2   Report Post  
JulieD
 
Posts: n/a
Default

Hi Wayne

the COUNTA function will count the number of non blank cells in a range
=COUNTA(A1:A8)
will return 6 with your example data

to count the number of blanks use
=COUNTBLANK(A1:A8)
will return 2 with your example data

If, however, you really want to use a COUNTIF function then this will work:
=COUNTIF(A1:A8,"<"&"")
to count non-blanks

Hope this helps

Cheers
JulieD

"Wayne" wrote in message
...
How can I get the CountIf function to count the number of
cells in a range where the cells are not empty?

Typ cell contents...

1a
1b
2.1
2.2
(empty)
(empty)
3.2.2
3.2.2
-----
total cell count of non empty cells = 6
total number of cells in range = 8


regards

Wayne



  #3   Report Post  
Max
 
Posts: n/a
Default

Assume the source range is A1:A20

Try in say B1: =SUMPRODUCT(--(A1:A20<""))

Adapt the range "A1:A20" to suit

Note that you can't use entire column
references, e.g. A:A, B:B, etc in SUMPRODUCT
but you can use a range like: A1:A65535

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Wayne" wrote in message
...
How can I get the CountIf function to count the number of
cells in a range where the cells are not empty?

Typ cell contents...

1a
1b
2.1
2.2
(empty)
(empty)
3.2.2
3.2.2
-----
total cell count of non empty cells = 6
total number of cells in range = 8


regards

Wayne



  #4   Report Post  
Alan Beban
 
Posts: n/a
Default

Max wrote:
Assume the source range is A1:A20

Try in say B1: =SUMPRODUCT(--(A1:A20<""))

How can I get the CountIf function to count the number of
cells in a range where the cells are not empty?

Typ cell contents...

1a
1b
2.1
2.2
(empty)
(empty)
3.2.2
3.2.2
-----
total cell count of non empty cells = 6
total number of cells in range = 8


Although the posted illustration at first glance seems simple, in order
to decide on a workable formula one really needs to specify what is
meant by "empty" (e.g., blanks, empty strings, ', etc.). COUNTIF,
COUNTBLANK and SUMPRODUCT count different things as blank. And the above
SUMPRODUCT formula won't work, even on what it counts, if there are
error values in the range (other than #N/A--go figure!)

Alan Beban
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trendlines to ignore empty cells Hoochi Coochi Man Charts and Charting in Excel 7 January 14th 05 01:31 PM
Convert data of cells to any type: Number, Date&Time, Text Kevin Excel Discussion (Misc queries) 0 December 30th 04 06:55 AM
Sumproduct ... Empty Cells vs Spaces? Ken Excel Discussion (Misc queries) 9 December 17th 04 08:03 PM
Empty Cells, Spaces, Cond Format? Ken Excel Discussion (Misc queries) 3 December 4th 04 04:47 PM
empty cells in ranges UniDave Excel Discussion (Misc queries) 2 November 26th 04 02:18 AM


All times are GMT +1. The time now is 02:18 AM.

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

About Us

"It's about Microsoft Excel"