Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ken D.
 
Posts: n/a
Default Division by Zero Error

I am using this formula to average the values in cells F49:J49 if the value
is greater than zero.

=SUMIF(F49:J49,"0")/COUNTIF(F49:J49,"0")

When all values are 0, I'm getting the division by zero error.

Just a little help please...
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bpeltzer
 
Posts: n/a
Default Division by Zero Error

You could put the entire average calculation inside an if that detects a 0
denominator and avoids the division in such cases:
=if(countif(F49:j49,"0")=0, 0, your average calculation)

"Ken D." wrote:

I am using this formula to average the values in cells F49:J49 if the value
is greater than zero.

=SUMIF(F49:J49,"0")/COUNTIF(F49:J49,"0")

When all values are 0, I'm getting the division by zero error.

Just a little help please...

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Vito
 
Posts: n/a
Default Division by Zero Error


Do you just want a blank cell if all cells are zero?

If so,

=IF(SUM(F49:J49)=0,"",SUMIF(F49:J49,"0")/COUNTIF(F49:J49,"0"))


--
Vito
------------------------------------------------------------------------
Vito's Profile: http://www.excelforum.com/member.php...o&userid=29182
View this thread: http://www.excelforum.com/showthread...hreadid=494713

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ken D.
 
Posts: n/a
Default Division by Zero Error

Thanks Vito,

I used this solution and it worked terrific.

Thanks again...

"Vito" wrote:


Do you just want a blank cell if all cells are zero?

If so,

=IF(SUM(F49:J49)=0,"",SUMIF(F49:J49,"0")/COUNTIF(F49:J49,"0"))


--
Vito
------------------------------------------------------------------------
Vito's Profile: http://www.excelforum.com/member.php...o&userid=29182
View this thread: http://www.excelforum.com/showthread...hreadid=494713


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ashish Mathur
 
Posts: n/a
Default Division by Zero Error

Hi,

You may use the following array formula (Ctrl+Shift+Enter):

=average(if((F49:J490),F49:J49))

Regards,

Ashish Mathur

"Ken D." wrote:

I am using this formula to average the values in cells F49:J49 if the value
is greater than zero.

=SUMIF(F49:J49,"0")/COUNTIF(F49:J49,"0")

When all values are 0, I'm getting the division by zero error.

Just a little help please...



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Vito
 
Posts: n/a
Default Division by Zero Error


Ashish Mathur Wrote:
Hi,

You may use the following array formula (Ctrl+Shift+Enter):

=average(if((F49:J490),F49:J49))

Regards,

Ashish Mathur



That stills gets you the #DIV/0 error message, which the OP was getting
originally, when all cells in the range are 0


--
Vito
------------------------------------------------------------------------
Vito's Profile: http://www.excelforum.com/member.php...o&userid=29182
View this thread: http://www.excelforum.com/showthread...hreadid=494713

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
DIV/0! error in SumProduct formula with no division Irrational Excel Worksheet Functions 1 August 18th 05 01:39 AM
How can I prevent the "division by zero" error in this formula Watercolor artist Excel Worksheet Functions 2 June 27th 05 03:31 PM
Error trapped only while stepping through the code - Not triggered when run Jeff Excel Discussion (Misc queries) 7 March 7th 05 06:29 PM
Error trapped only while stepping through the code - Not triggered when run Jeff Excel Discussion (Misc queries) 0 February 28th 05 06:26 PM
division by zero error peter Setting up and Configuration of Excel 2 January 9th 05 08:02 PM


All times are GMT +1. The time now is 05:27 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"