Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default How can I use countif to count BOTH zeros AND blank cells as zer

How can I use countif to count BOTH zeros AND blank cells as zeros?
Wondering if I am unaware of a formula that exists that is less messy than my
formula below to achieve this answer.

I was going to do this: =COUNTBLANK([range]) + COUNTIF([range], 0)

D.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default How can I use countif to count BOTH zeros AND blank cells as zer

Part of the problem is blank cells can be due to being *truly* empty, or they
can be "" (such as the result of some formula)

=IF(some_condition, "Condition True", "")

If the cells are truly empty, you could try
=SUMPRODUCT(--(A1:A9=0))
which treats empty cells as 0. But you will get an incorrect result if your
"empty" cells actually have an empty string, "".

I usually use the solution you've already found.



"Danielle" wrote:

How can I use countif to count BOTH zeros AND blank cells as zeros?
Wondering if I am unaware of a formula that exists that is less messy than my
formula below to achieve this answer.

I was going to do this: =COUNTBLANK([range]) + COUNTIF([range], 0)

D.

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
sum of blank cells returns zeros Mar_W Excel Worksheet Functions 7 November 28th 06 05:53 PM
Average Function (include Blank Cells and Zeros) [email protected] Excel Discussion (Misc queries) 17 June 27th 06 01:33 PM
References to Blank Cells turn into Zeros statusquo Excel Worksheet Functions 3 December 13th 05 02:44 AM
how can I count blank cells as a zero, when using formula please?? Ted Excel Worksheet Functions 5 November 22nd 05 06:14 PM
how eliminate zeros in blank cells using paste link sea kayaker Excel Worksheet Functions 2 April 16th 05 10:19 PM


All times are GMT +1. The time now is 04:42 PM.

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"