Formula returns #DIV/0 error, please help me fix it

cdc_979

New Member
Joined
Dec 7, 2004
Messages
3
Hi, I'm working on updating a spreadsheet someone else created, and see there are many #DIV/0 erros.
The formula is =IF(H7<B39*(I7/(I7+I8+I9+I10)),H7,B39*(I7/(I7+I8+I9+I10)))

When (I7+I8+I9+I10) returns a result of "0" that's when I get the #DIV/0 error. Can someone help me update the formula so if the result is an error, that it's either blank or "0"?

Thanks, I've looked through forums and tried different suggestions, but I can't seem to figure it out.
cdc
 
Last edited:

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Try the following

<b39*(i7 (i7+i8+i9+i10)),h7,b39*(i7="" (i7+i8+i9+i10))),="" "")
Code:
=IFERROR(IF(H7< B39*(I7/(I7+I8+I9+I10)),H7,B39*(I7/(I7+I8+I9+I10))), "")
Should work<b39*(i7 (i7+i8+i9+i10)),h7,b39*(i7="" (i7+i8+i9+i10))),="" "")<="" html=""></b39*(i7></b39*(i7>
 
Last edited:
Upvote 0
You can wrap your formula in =IFERROR(A2/A3,0)



=IFERROR(IF(H7< B39*(I7/(I7+I8+I9+I10)),H7,B39*(I7/(I7+I8+I9+I10))),0)
or =IFERROR(IF(H7< B39*(I7/(I7+I8+I9+I10)),H7,B39*(I7/(I7+I8+I9+I10))),"") if you want a blank displayed
 
Last edited:
Upvote 0
Hi MrTeeny,

Just for your info it took me ages to post as there's a bug with the forum.. If you have "<" and then a letter it cuts the formula off.. You need to leave a space between these two characters..
 
Upvote 0
First, we can simplify the original formula signifigantly..

Instead of
If(H7 < calculation,H7,calculation)<calculation,h7,calculation)
You can do
=MIN(H7,calculation)

Much simpler, and more importantly, more efficient as it only does the calculation once.

Then we just need to add iferror

Try
=IFERROR(MIN(H7,B39*(I7/(I7+I8+I9+I10))),"")</calculation,h7,calculation)
 
Last edited:
Upvote 0
Try the following

<b39*(i7 (i7+i8+i9+i10)),h7,b39*(i7="" (i7+i8+i9+i10))),="" "")
Code:
=IFERROR(IF(H7< B39*(I7/(I7+I8+I9+I10)),H7,B39*(I7/(I7+I8+I9+I10))), "")
Should work<b39*(i7 (i7+i8+i9+i10)),h7,b39*(i7="" (i7+i8+i9+i10))),="" "")<="" html=""></b39*(i7></b39*(i7>

Thank you! It worked. I wasn't sure where to put the IFERROR, been a while since I've done this.
 
Upvote 0
If any of the input cells themselves contain an error, wrapping any formula in IFERROR will mask that error. That may may not be possible with your data or "" may be what you want returned in that instance anyway.
However, your question was about how to deal with the #DIV/0! error. This is how I would address that error without interfering with other types of errors that you may still want to know about.

=IF(SUM(I7:I10),MIN(H7,B39*I7/SUM(I7:I10)),"")
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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