#DIV/0! error how to fix

shellt

New Member
Joined
Aug 3, 2010
Messages
6
Hi,

I have a formula

=AVERAGEIF(H99:H111,">0",H99:H111)

Some of the answers are returning the error #DIV/0! due to there being no figures in what is being averaged, however it is a big table and I don't want to have to do individual formula's to get rid of the error.

How can I get rid of the error, while still making this formula work?

Cheers,
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Would this help
Code:
=SUM(H99:H111)/COUNTIF(H99:H111,">0")
 
Upvote 0
shellt - not sure exactly what you mean, here are 2 answers.

perhaps do a search and replace where there are no figures with a zero (Find blank and replace with 0, matching entire cell contents)

or modify the formula so that if it is an error it does not display the #DIV/0! result :
=IF(ISERROR(AVERAGEIF(H99:H111,">0",H99:H111)),"",AVERAGEIF(H99:H111,">0",H99:H111))

trust this helps, Ian R.
 
Upvote 0
So are you saying the DIV error is further up the table and this is the formula at the bottom ??
If so, what formula are you using that creates the DIV error
 
Upvote 0
Hi,

I have a formula

=AVERAGEIF(H99:H111,">0",H99:H111)

Some of the answers are returning the error #DIV/0! due to there being no figures in what is being averaged, however it is a big table and I don't want to have to do individual formula's to get rid of the error.

How can I get rid of the error, while still making this formula work?

Cheers,

Try...

=IFERROR(AVERAGEIF(H99:H111,">0",H99:H111),"")
 
Upvote 0
Hi All,

I've fixed it - the formula below worked.

Thanks all for your help.

=IF(ISERROR(AVERAGEIF(D5:D17,">0",D5:D17)),0,(AVERAGEIF(D5:D17,">0",D5:D17)))
 
Upvote 0
Hi All,

I've fixed it - the formula below worked.

Thanks all for your help.

=IF(ISERROR(AVERAGEIF(D5:D17,">0",D5:D17)),0,(AVERAGEIF(D5:D17,">0",D5:D17)))

Try to pay attention to help that is already provided. Since you have AVERAGEIF, you also must have IFERROR on you system. The following avoids computing the same thing twice:

=IFERROR(AVERAGEIF(D5:D17,">0",D5:D17),0)
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

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