Divide By Zero Error

paul29berks

Active Member
Does anyone know how I can prevent the #DIV/0 error appearing?

Thanks

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Don't divide by 0.

But seriously folks, why do you have 0's in your denominator? Can you fix this or do you just want to suppress the error? To suppress the error, you could do something like: =IF(B1,A1/B1,0)

=IF(OR(AR18=0,\$AR22=0),(\$BN18)/(\$BN22)*\$CF22,(AR18/\$AR22)*\$CF22)

This is the formula I am using

So if AR18 or AR22 is 0, use the BN cells, otherwise use the AR cells. Therefore, the DIV by 0 is because BN22 is 0. What do you want to have happen if BN22 is 0 while one of the 2 AR cells is also 0?

Just to display a 0 value

Then try this:

IF(OR(AR18=0,\$AR22=0),IF(\$BN22,(\$BN18)/(\$BN22)*\$CF22,0),(AR18/\$AR22)*\$CF22)

or a little cleaner, pull the CF22 outside the IF

IF(OR(AR18=0,\$AR22=0),IF(\$BN22,(\$BN18)/(\$BN22),0),(AR18/\$AR22))*\$CF22

I have the following formula which I am using and divide by zero errors are occuring - does anyone know how I can amend this to show value 0?

=IF(AND(\$D\$8=0,\$P\$8=0),BV\$8*(\$P\$7+\$AF\$7)/(\$P\$8+\$AF\$8),IF(AR\$7=0,BV\$8*(\$AT\$7+\$BJ\$7)/(\$AT\$8+\$BJ\$8),BV\$8*(\$AT\$7/\$AT\$8)))

Thanks

I've found a fairly easy way to get rid of div/0 errors is to do something like:

if(isnumber(*Enter Your Formula Here*), *Copy/Paste that same formula here*, 0)

Everyone has their own individual method - they all tend to be if something then else 0 - Anyone know of anything other than an if formula?

for info the one i use is:

IF(ISERR(A1/A2),0,(A1/A2))

Replies
2
Views
497
Replies
2
Views
146
Replies
14
Views
358
Replies
1
Views
535
Replies
6
Views
361

1,217,673
Messages
6,137,914
Members
450,098
Latest member
Ikmal Sabri

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.

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

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