Divide By Zero Error

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

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))
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,697
Messages
5,855,226
Members
431,712
Latest member
Stella J

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