Divide By Zero Error

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Seti

Well-known Member
Joined
May 19, 2002
Messages
2,916
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)
 

paul29berks

Active Member
Joined
Mar 15, 2004
Messages
293
=IF(OR(AR18=0,$AR22=0),($BN18)/($BN22)*$CF22,(AR18/$AR22)*$CF22)

This is the formula I am using
 

Seti

Well-known Member
Joined
May 19, 2002
Messages
2,916
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?
 

paul29berks

Active Member
Joined
Mar 15, 2004
Messages
293

ADVERTISEMENT

Just to display a 0 value
 

Seti

Well-known Member
Joined
May 19, 2002
Messages
2,916
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
 

paul29berks

Active Member
Joined
Mar 15, 2004
Messages
293

ADVERTISEMENT

Thanks for your help
 

paul29berks

Active Member
Joined
Mar 15, 2004
Messages
293
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
 

Theadish

New Member
Joined
Jan 21, 2005
Messages
34
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)
 

IrvineP

New Member
Joined
Jan 19, 2003
Messages
16
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))
 

Watch MrExcel Video

Forum statistics

Threads
1,130,182
Messages
5,640,668
Members
417,160
Latest member
Timon82

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
Top