#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,
 

Some videos you may like

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,116
Office Version
2013
Platform
Windows
Would this help
Code:
=SUM(H99:H111)/COUNTIF(H99:H111,">0")
 

Mr_Roscoe

Board Regular
Joined
Mar 28, 2006
Messages
200
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.
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,116
Office Version
2013
Platform
Windows

ADVERTISEMENT

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
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,192
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),"")
 

shellt

New Member
Joined
Aug 3, 2010
Messages
6

ADVERTISEMENT

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)))
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,192
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)
 

shellt

New Member
Joined
Aug 3, 2010
Messages
6
Thanks - but I already had the formula I had before getting the other reply.
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,506
Messages
5,511,706
Members
408,862
Latest member
sidneybc

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top