Divide by Zero

hal1543

New Member
Joined
May 1, 2002
Messages
11
I have a worksheet:

Column B is a value for year 2002
Column C is a value for year 2001
Column D is a percentage of increase or decrease between the two years.

If both B & C are equal to zero I want
zero in column D, otherwise I want the percent of increase or decrease versus year 2001. In no instance to I want a Divide by Zero error.

thanks,
This message was edited by hal1543 on 2002-05-02 06:54
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Thanks Al,

I tried your formula, but if A is greater
than zero and B is = zero, I'm getting that
dredded Divide by Zero error.

Hal
 
Upvote 0
Give this a whirl:

=IF(c1=0,0,b1/c1)

_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue">O</font></font></font>
This message was edited by NateO on 2002-05-02 10:57
 
Upvote 0
how about
=if(or(b1=0,c1=0),0,b1/c1)
this way, if either one is zero, you get a zero in return.
 
Upvote 0
Here's where we need to step back from Excel and remember our basic arithmetic. If B1 is zero and you divide this by a number greater than zero, the solution is always zero, no need to extend the if statement.
 
Upvote 0
Depending on what you divide by what, I'd use Nate's suggestion (a bit shortened):

=IF(C1,B1/C1,0)

or

=IF(B1,C1/B1,0)

Aladin
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,698
Members
448,979
Latest member
DET4492

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