Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 90
Default Calculations resulting in #DIV/0!

The following example is:

a1 0%
a2 0%
a3 0%
a4 0%
a5 0%
a6 0%

Here's what I have:
=sum(a1:a6)/countif(a1:a6,"0")

I have multiple cells using this formual that have numbers and function fine.
But, with no numbers to calculate against I'm getting the #DIV/0!.
How can I fix this so I don't have the #DIV/0!?

I've been reading about =IF but I've tried numerous ways and have come up
with nothing working.

Thanks for your help.

Debbie

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Calculations resulting in #DIV/0!

=if(countif(a1:a6,"0")=0,"",sum(a1:a6)/countif(a1:a6,"0"))
--
Gary''s Student - gsnu200770
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Calculations resulting in #DIV/0!

=IF(COUNTIF(A1:A6,"0",sum(a1:a6)/countif(a1:a6,"0"),"Not data")
or
=IF(ISERRROR(sum(a1:a6)/countif(a1:a6,"0")),"Problem",sum(a1:a6)/countif(a1:a6,"0"))
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Debbie" wrote in message
...
The following example is:

a1 0%
a2 0%
a3 0%
a4 0%
a5 0%
a6 0%

Here's what I have:
=sum(a1:a6)/countif(a1:a6,"0")

I have multiple cells using this formual that have numbers and function
fine.
But, with no numbers to calculate against I'm getting the #DIV/0!.
How can I fix this so I don't have the #DIV/0!?

I've been reading about =IF but I've tried numerous ways and have come up
with nothing working.

Thanks for your help.

Debbie



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Calculations resulting in #DIV/0!

Typo
=IF(COUNTIF(A1:A6,"0")0,sum(a1:a6)/countif(a1:a6,"0"),"Not data")

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Bernard Liengme" wrote in message
...
=IF(COUNTIF(A1:A6,"0",sum(a1:a6)/countif(a1:a6,"0"),"Not data")
or
=IF(ISERRROR(sum(a1:a6)/countif(a1:a6,"0")),"Problem",sum(a1:a6)/countif(a1:a6,"0"))
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Debbie" wrote in message
...
The following example is:

a1 0%
a2 0%
a3 0%
a4 0%
a5 0%
a6 0%

Here's what I have:
=sum(a1:a6)/countif(a1:a6,"0")

I have multiple cells using this formual that have numbers and function
fine.
But, with no numbers to calculate against I'm getting the #DIV/0!.
How can I fix this so I don't have the #DIV/0!?

I've been reading about =IF but I've tried numerous ways and have come up
with nothing working.

Thanks for your help.

Debbie





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Calculations resulting in #DIV/0!

"Bernard Liengme" wrote...
....
=IF(COUNTIF(A1:A6,"0")0,sum(a1:a6)/countif(a1:a6,"0"),"Not data")

....

An alternative approach,

=SUM(A1:A6)/MAX(1,COUNTIF(A1:A6,"0"))

which would return 0 if none of the cells in A1:A6 contained a
positive number, but since the COUNTIF criteria implies only positive
values would be valid, then the average of any set of positive numbers
would be positive, so a 0 result would be an unambiguous indication
that the average wasn't valid. Possible at this point to use a custom
number format, e.g.,

[<=0]"no valid data";General


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 90
Default Calculations resulting in #DIV/0!

Thanks everyone, for your quick responses.
This helps me complete my calculations.

Much appreciated!
Debbie

"Harlan Grove" wrote:

"Bernard Liengme" wrote...
....
=IF(COUNTIF(A1:A6,"0")0,sum(a1:a6)/countif(a1:a6,"0"),"Not data")

....

An alternative approach,

=SUM(A1:A6)/MAX(1,COUNTIF(A1:A6,"0"))

which would return 0 if none of the cells in A1:A6 contained a
positive number, but since the COUNTIF criteria implies only positive
values would be valid, then the average of any set of positive numbers
would be positive, so a 0 result would be an unambiguous indication
that the average wasn't valid. Possible at this point to use a custom
number format, e.g.,

[<=0]"no valid data";General

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Calculations resulting in #DIV/0!

Very nice!
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Harlan Grove" wrote in message
...
"Bernard Liengme" wrote...
...
=IF(COUNTIF(A1:A6,"0")0,sum(a1:a6)/countif(a1:a6,"0"),"Not data")

...

An alternative approach,

=SUM(A1:A6)/MAX(1,COUNTIF(A1:A6,"0"))

which would return 0 if none of the cells in A1:A6 contained a
positive number, but since the COUNTIF criteria implies only positive
values would be valid, then the average of any set of positive numbers
would be positive, so a 0 result would be an unambiguous indication
that the average wasn't valid. Possible at this point to use a custom
number format, e.g.,

[<=0]"no valid data";General



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
formula does not display the resulting value in the cell Liliana New Users to Excel 2 July 19th 07 08:50 AM
Excel adds significant digits, resulting in errors in calculations Scoutwert Excel Worksheet Functions 6 September 19th 06 03:27 PM
Formula to convert resulting #N/A to 0 cehipso Excel Worksheet Functions 2 July 7th 06 03:14 AM
Formula resulting in 0 adodson Excel Discussion (Misc queries) 10 May 31st 06 07:20 PM
sumproduct resulting in #N/A schleppy2 Excel Worksheet Functions 2 September 28th 05 03:28 PM


All times are GMT +1. The time now is 02:00 PM.

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

About Us

"It's about Microsoft Excel"