Eliminate #DIV/0! error in Avergage formula

DJPaton

Board Regular
Joined
Feb 11, 2009
Messages
106
Hi
I am trying to eliminate the #DIV/0! error when the cells are empty in a simple average formula =AVERAGE(F75:H75). I have tried =IF(D75=0,0,(AVERAGE(B75:D75))) which eliminates the error but doesn't return the average of cells F and G. I am sure the answer is in front of me but can't see it so I thought I would ask the MATERS! Any help will be greatly appreciated.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
This will only return an average if at least 1 cell has a number

=IF(COUNT(F75:H75),AVERAGE(F75:H75),0)
 
Upvote 0
While Colins formula will work with numbers, it would also include 0 values. If it's just numbers greater than 0 to be averaged, =AVERAGEIF(H4:H11,">"&0,H4:H11)

or if your version doesn't have Averageif

=SUM(H4:H11)/COUNTIF(H4:H11,">"&0)
 
Upvote 0
I'm always partial to these:

Excel 2007+:
=IFERROR(AVERAGE(F75:H75),"")

Excel 2003-:
=IF(ISERROR(AVERAGE(F75:H75)),"",AVERAGE(F75:H75))
 
Upvote 0
Hi scottylad2

It would only be values over 0 that I would be using - that or blank until the value is known.

When I tried the =AVERAGEIF(H4:H11,">"&0,H4:H11) formula I get an #NAME? error which I assume is becuase my version doesn't support the formula. The =SUM(H4:H11)/COUNTIF(H4:H11,">"&0) formula still returns a #DIV/0! error - am I doing something wrong?
Thanks for your help.
 
Upvote 0
Hi CWatts
Yes that works brilliantly and I like it especially because it returns a blank cell until the values are entered / known, even better!
Thanks so much and thanks to all.
Cheers

Derek
 
Upvote 0
Excel Workbook
EF
25.410
33
47
5
62
7
85
Sheet1
Excel 2010
Cell Formulas
RangeFormula
E2=IFERROR(SUM(F2:F8)/COUNT(IF(F2:F8>0,F2:F8,""))"")

What version of Excel are you using?

this will also remain blank till values are added
 
Last edited:
Upvote 0
Hi scottylad2

It would only be values over 0 that I would be using...
The =SUM(H4:H11)/COUNTIF(H4:H11,">"&0) formula still returns a #DIV/0! error - am I doing something wrong?
Thanks for your help.
That formula will return the #DIV/0! error if there are no numbers >0 in the range.

However, if the numbers you're dealing with will only be >0 then there's no need to use the COUNTIF(H4:H11,">"&0). You can simply use AVERAGE like Colin suggested.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,254
Members
452,900
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top