A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#DIV/0! to read as 0



 
 
Thread Tools Display Modes
  #1  
Old January 20th, 2007, 07:38 AM posted to microsoft.public.excel.misc
PATTO
external usenet poster
 
Posts: 1
Default #DIV/0! to read as 0

Is there a simple formula for displaying "0" as a result, not "#DIV/0!", when
cells are intentionally left blank or contain "0" as a divisor ?
If so, how is it applied with a formula already in the cell?
Hope someone's got the answer..
thanks



  #2  
Old January 20th, 2007, 07:55 AM posted to microsoft.public.excel.misc
[email protected]
external usenet poster
 
Posts: 379
Default #DIV/0! to read as 0

PATTO wrote:
Is there a simple formula for displaying "0" as a result, not "#DIV/0!", when
cells are intentionally left blank or contain "0" as a divisor ?
If so, how is it applied with a formula already in the cell?


Usually, the best way is to simply test the divisor. If you know D1
can be only blank or a number, you can do the following:

=if(D1=0, 0, A1/D1)

If the divisor is an expression, you might need to test it. For
example:

=if(D1+D2=0, 0, A1/(D1+D2))

If the divisor might contain a non-number, you might want to do
something like the following:

=if(N(D1)=0, 0, A1/D1)

  #3  
Old January 20th, 2007, 08:22 AM posted to microsoft.public.excel.misc
John Bundy
external usenet poster
 
Posts: 455
Default #DIV/0! to read as 0

you can use an iserror such as
=IF(ISERROR(1/0),"",1/0)
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"PATTO" wrote:

Is there a simple formula for displaying "0" as a result, not "#DIV/0!", when
cells are intentionally left blank or contain "0" as a divisor ?
If so, how is it applied with a formula already in the cell?
Hope someone's got the answer..
thanks



  #4  
Old January 20th, 2007, 01:55 PM posted to microsoft.public.excel.misc
daddylonglegs
external usenet poster
 
Posts: 289
Default #DIV/0! to read as 0

If you have a formula like =A1/B1 returning an unwanted #DIV/0! error then to
show zero instead

=IF(B1,A1/B1,0)

"John Bundy" wrote:

you can use an iserror such as
=IF(ISERROR(1/0),"",1/0)
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"PATTO" wrote:

Is there a simple formula for displaying "0" as a result, not "#DIV/0!", when
cells are intentionally left blank or contain "0" as a divisor ?
If so, how is it applied with a formula already in the cell?
Hope someone's got the answer..
thanks



  #5  
Old January 20th, 2007, 03:03 PM posted to microsoft.public.excel.misc
JE McGimpsey
external usenet poster
 
Posts: 2,468
Default #DIV/0! to read as 0

While this will work to display "" rather than #DIV/0 (though the OP
wanted to display 0), it will also cause any other errors to fail
silently.

Better to test the divisor:

=IF(B1=0, 0, A1/B1)

In article ,
John Bundy (remove) wrote:

you can use an iserror such as
=IF(ISERROR(1/0),"",1/0)

  #6  
Old January 20th, 2007, 03:38 PM posted to microsoft.public.excel.misc
Chip Pearson
external usenet poster
 
Posts: 1,343
Default #DIV/0! to read as 0

Just for the record, in Excel 2007 you can use the new IFERROR function.
E.g.,

=IFERROR(x/y,"")

It will return x/y is no error occurs, or an empty string if an error
occurs.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"John Bundy" (remove) wrote in message
news
you can use an iserror such as
=IF(ISERROR(1/0),"",1/0)
--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"PATTO" wrote:

Is there a simple formula for displaying "0" as a result, not "#DIV/0!",
when
cells are intentionally left blank or contain "0" as a divisor ?
If so, how is it applied with a formula already in the cell?
Hope someone's got the answer..
thanks





  #7  
Old January 20th, 2007, 04:42 PM posted to microsoft.public.excel.misc
[email protected]
external usenet poster
 
Posts: 379
Default #DIV/0! to read as 0

Chip Pearson wrote:
Just for the record, in Excel 2007 you can use the new IFERROR function.
E.g.,
=IFERROR(x/y,"")
It will return x/y is no error occurs, or an empty string if an error occurs.


Kudos to Bill's Kids for finally recognizing the need for this. It
avoids evaluating every expression twice (klunk!).

Now, did they also increase the nested function depth to at least 8 ;-).

  #8  
Old January 20th, 2007, 05:40 PM posted to microsoft.public.excel.misc
Chip Pearson
external usenet poster
 
Posts: 1,343
Default #DIV/0! to read as 0

Now, did they also increase the nested function depth to at least 8 ;-).

Yes, they did. The limit now is, I think, 64 nested functions. I would never
want to try to debug a formula with 64 levels of parens, but you can now
write such a function. Sixty-four parens is

)))))))))))))))))))))))))))))))))))))))))))))))))) ))))))))))))))

It would be no small effort to try to match up opening and closing parens.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


wrote in message
oups.com...
Chip Pearson wrote:
Just for the record, in Excel 2007 you can use the new IFERROR function.
E.g.,
=IFERROR(x/y,"")
It will return x/y is no error occurs, or an empty string if an error
occurs.


Kudos to Bill's Kids for finally recognizing the need for this. It
avoids evaluating every expression twice (klunk!).

Now, did they also increase the nested function depth to at least 8 ;-).



  #9  
Old January 20th, 2007, 09:05 PM posted to microsoft.public.excel.misc
Dana DeLouis
external usenet poster
 
Posts: 468
Default #DIV/0! to read as 0

Now, did they also increase the nested function depth to at least 8 ;-).

Here's some interesting late night reading...

Improving Performance in Excel 2007
http://msdn2.microsoft.com/en-us/library/aa730921.aspx

--
HTH :)
Dana DeLouis
Windows XP & Office 2003


wrote in message
oups.com...
Chip Pearson wrote:
Just for the record, in Excel 2007 you can use the new IFERROR function.
E.g.,
=IFERROR(x/y,"")
It will return x/y is no error occurs, or an empty string if an error
occurs.


Kudos to Bill's Kids for finally recognizing the need for this. It
avoids evaluating every expression twice (klunk!).

Now, did they also increase the nested function depth to at least 8 ;-).



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:29 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.