Getting rid of #DIV/0! in Average function

Waylor

New Member
Joined
Jul 10, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I'm trying to make an interactive sheet which requires input from other sheets. I've got the formula for filling the data from other sheets working fine. But trying to make my 'dashboard' work has been tricky (I'm a fiddler, not an expert!)

Attached is a picture where I've been able to get one of my averages to work where it ignores cells with 0% in them (D4), but when that cell is empty again and all the values are 0%, it shows '#DIV/0!' when I'd like it just to say 0% like D12 (this one is just =B12).

D18 & D25 are examples of what I mean. How do I fix this? Have wasted too much time trying formula's searching google

Thanks!
 

Attachments

  • Capture.PNG
    Capture.PNG
    45.6 KB · Views: 12

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
=IFERROR(yourformula,0)

What am I doing wrong? I can't seem to add in the ',0' that you've included without causing an error. The closest I can get is this, and it displays 'TRUE'
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    7.1 KB · Views: 8
Upvote 0
I think you just need this:

=IFERROR(AVERAGEIF(B4:B9,"<>"0,B4:B9),0)
You may not need the AVERAGE IF at all.
Just
Excel Formula:
=IFERROR(AVERAGE(B4:B9),0)
may get what you want as well.

Book1
ABC
1
2
3
450
555
60
760
865
970
10
1160
12or:50
13
Sheet5
Cell Formulas
RangeFormula
B11B11=IFERROR(AVERAGEIF(B4:B9,"<>0",B4:B9),0)
B12B12=IFERROR(AVERAGE(B4:B9),0)
 
Upvote 0
I think you just need this:

=IFERROR(AVERAGEIF(B4:B9,"<>"0,B4:B9),0)
You may not need the AVERAGE IF at all.
Just
Excel Formula:
=IFERROR(AVERAGE(B4:B9),0)
may get what you want as well.

Book1
ABC
1
2
3
450
555
60
760
865
970
10
1160
12or:50
13
Sheet5
Cell Formulas
RangeFormula
B11B11=IFERROR(AVERAGEIF(B4:B9,"<>0",B4:B9),0)
B12B12=IFERROR(AVERAGE(B4:B9),0)

That got it! Thanks! (I had to change the "<>"0 part to "<>0")
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,619
Latest member
Shiv1198

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