#DIV/0! error message

Shelly68

Board Regular
Joined
Sep 12, 2006
Messages
73
I'm trying to calculate a formula that is trying to divide a cell that is ZERO, what is the formula I put in to make it appear as a Zero answer instead of the above (sorry that looks all muddled to me)
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
=IF(X1=0,0,formula)


where X1 is the cell that you are dividing by that may house a zero.

enter your formula in the formula place
 
Upvote 0
sorry you just beat me, I figured I should probably put the formula in that I'm talking about (I did a search and saw that others had as well).

H23/(G23*$J$1)*G23

where H23 equals zero, (as a result of another formula)
G23 equals zero, (as a result of another formula)
and J1 equals 152

this is showing up as #DIV/0!

Does that make it easier to understand what I'm trying to say
 
Upvote 0
I'm trying to calculate a formula that is trying to divide a cell that is ZERO...
But later, you wrote,
H23/(G23*$J$1)*G23

where H23 equals zero, (as a result of another formula)
G23 equals zero, (as a result of another formula)
and J1 equals 152

this is showing up as #DIV/0!
The error you are getting is not caused by "trying to divide a cell that is ZERO" (that is, cell H23). That will return a 0, not an error. The error you are getting is because you are dividing by zero (that is, cell G23). It's okay if H23 is zero, but not that G23 is zero.

The suggestion that NBVC gave will work as far as not giving you an error (substitute G23 for X1), but realize that it violates mathematical rules. Dividing by zero isn't zero, and in fact is more like infinity (the smaller the number you divide by, the larger the answer).

This would be more correct: =IF(G23=0,"Undefined",H23/(G23*$J$1)*G23)
 
Upvote 0
Okay I tried that but it's now giving an answer of undefined, (which does not work either because I'm adding these elsewhere later on).

Is it not possible just to have it say 0??
 
Upvote 0
Okay I tried that but it's now giving an answer of undefined, (which does not work either because I'm adding these elsewhere later on).

Is it not possible just to have it say 0??

=IF(N(G23*$J$1),H23/(G23*$J$1)*G23,0)
 
Upvote 0
Okay I tried that but it's now giving an answer of undefined, (which does not work either because I'm adding these elsewhere later on).

Is it not possible just to have it say 0??

Yes it is:

=IF(G23=0,0,H23/(G23*$J$1)*G23)
 
Upvote 0
Thank you everybody concerned for your help.

It works and makes life a heck of a lot easier,

thanks again!!!!
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,165
Members
448,870
Latest member
max_pedreira

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