ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   when dragging formula how do i avoid #DIV/0! (https://www.excelbanter.com/excel-discussion-misc-queries/53879-when-dragging-formula-how-do-i-avoid-div-0-a.html)

derwood

when dragging formula how do i avoid #DIV/0!
 
When dragging a formula and a field has a nil value is there a way to
avoid the result showing as #DIV/0!. Can it just skip this or return a
0 value or leave blank.


JMMach

when dragging formula how do i avoid #DIV/0!
 
Dividing by zero is undefined in math hence the error.
Use the If function to test for a zero divisor:
Suppose you have a value in Column A and another value in Column B and in
Column C you have the formula A5/B5.
If B5 is empty - has a value of zero - or has some formula that results in a
zero, then your formula in Column C will result in #DIV/0!
Solve it by replacing the formula in Column C with this:
=IF(B5=0,"",Ad/B5)
What this does is checks to see if it is OK to do the calculation before it
does it. And if it is NOT OK then it shows nothing - a blank - in the cell.
That is what the double Quotes "" does.
TTFN
JMMach


"derwood" wrote in message
oups.com...
When dragging a formula and a field has a nil value is there a way to
avoid the result showing as #DIV/0!. Can it just skip this or return a
0 value or leave blank.




JMMach

when dragging formula how do i avoid #DIV/0!
 
OPPS
My formula should have read: =IF(B5=0,"",A5/B5)
Sorry about that

TTFN
JMMach

"JMMach" wrote in message
...
Dividing by zero is undefined in math hence the error.
Use the If function to test for a zero divisor:
Suppose you have a value in Column A and another value in Column B and in
Column C you have the formula A5/B5.
If B5 is empty - has a value of zero - or has some formula that results in

a
zero, then your formula in Column C will result in #DIV/0!
Solve it by replacing the formula in Column C with this:
=IF(B5=0,"",Ad/B5)
What this does is checks to see if it is OK to do the calculation before

it
does it. And if it is NOT OK then it shows nothing - a blank - in the

cell.
That is what the double Quotes "" does.
TTFN
JMMach


"derwood" wrote in message
oups.com...
When dragging a formula and a field has a nil value is there a way to
avoid the result showing as #DIV/0!. Can it just skip this or return a
0 value or leave blank.






Jim May

when dragging formula how do i avoid #DIV/0!
 
You can also test for an error by entering:

=IF(IsError(A5/B5),"",A5/B5)



"JMMach" wrote in message
...
Dividing by zero is undefined in math hence the error.
Use the If function to test for a zero divisor:
Suppose you have a value in Column A and another value in Column B and in
Column C you have the formula A5/B5.
If B5 is empty - has a value of zero - or has some formula that results in
a
zero, then your formula in Column C will result in #DIV/0!
Solve it by replacing the formula in Column C with this:
=IF(B5=0,"",Ad/B5)
What this does is checks to see if it is OK to do the calculation before
it
does it. And if it is NOT OK then it shows nothing - a blank - in the
cell.
That is what the double Quotes "" does.
TTFN
JMMach


"derwood" wrote in message
oups.com...
When dragging a formula and a field has a nil value is there a way to
avoid the result showing as #DIV/0!. Can it just skip this or return a
0 value or leave blank.







All times are GMT +1. The time now is 12:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com