Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Marshall Scmidt
 
Posts: n/a
Default How do I get rid of the #/DIV/0! message

If I have a formula say (A2+A10)*A12/A15 if A15 is blank it returns
#/DIV/0!, how do i get it to return 0
--
Marshall
  #2   Report Post  
Hayeso
 
Posts: n/a
Default

=IF(ISERR((A2+A10)*A12/A15),"",(A2+A10)*A12/A15)

"Marshall Scmidt" wrote:

If I have a formula say (A2+A10)*A12/A15 if A15 is blank it returns
#/DIV/0!, how do i get it to return 0
--
Marshall

  #3   Report Post  
Niek Otten
 
Posts: n/a
Default

=IF(A15=0,0,(A2+A10)*A12/A15)

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"Marshall Scmidt" wrote in
message ...
If I have a formula say (A2+A10)*A12/A15 if A15 is blank it returns
#/DIV/0!, how do i get it to return 0
--
Marshall



  #4   Report Post  
Harlan Grove
 
Posts: n/a
Default

Hayeso wrote...
=IF(ISERR((A2+A10)*A12/A15),"",(A2+A10)*A12/A15)

....

Errors are not always a bad thing to see. #REF!, #NULL!, #NUM! and
#NAME? are always beneficial diagnostically. #DIV/0! is always easy to
avoid in direct calculations (check if the denominator term is zero).
Only #VALUE! and #N/A require trapping on an all too frequent basis.

Next, ISERR as opposed to ISERROR won't trap #N/A. Maybe you intended
that, but why allow #N/A but not #REF!, #NULL!, #NUM! and #NAME?
results?

In general you should only trap expected errors or expected values that
would give rise to errors, such as blank denominator terms. In this
case, the formula should only trap cell A15 blank, not A15=0. So

=IF(ISBLANK(A15),0,(A2+A10)*A12/A15)

and if this were part of a larger formula, you could use only a single
level of function calls with

(A2+A10)*A12*(1-ISBLANK(A15))/(A15+ISBLANK(A15))

More generally, to trap only specific errors, use

=IF(COUNT(1/(ERROR.TYPE(x)={3,7})),"error result","nonerror result")

where 3 == #VALUE! and 7 == #N/A.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculations And Order In Macros Carl Bowman Excel Discussion (Misc queries) 4 February 23rd 05 10:53 PM
when opening excel I receive a message that says file can't be fo. Ken Excel Discussion (Misc queries) 3 February 22nd 05 12:13 AM
changing the message in an error message The Villages DA Excel Worksheet Functions 2 February 18th 05 05:30 PM
Error Message appearing when saving a file JaneC Excel Discussion (Misc queries) 0 November 25th 04 10:35 PM
#num! error message Frank Kabel Excel Worksheet Functions 0 November 18th 04 07:07 PM


All times are GMT +1. The time now is 09:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"