Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
dim dim is offline
external usenet poster
 
Posts: 123
Default #DIV/0! Error......why is it ignoring the ' Otherwise "" ' ?

Hi all,
I have the following function:
=IF($E130,SUM(G13/(((($E13/2)/0.0393700787)*(($E13/2)/0.0393700787)*3.14159265)*$B13/0.0393700787)),IF($E13=0,SUM(G13/(($B13/0.0393700787)*($C13/0.0393700787)*($D13/0.0393700787))),""))

All works fine when there are values filled into B,C and D13, or B & E13.
Thats great, as intended...but....when there is no value in B13,C13,D13 or
E13, I get the error #DIV/0! in my cell.

Why is the very end part of my function, the ' Otherwise "" ' [,""] not
working?

I need it to just show a blank cell when there are no numbers in B,C,D or E13?

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default #DIV/0! Error......why is it ignoring the ' Otherwise "" ' ?

You don't get to your final part of the function because you've satisfied
the IF(E13=0,... condition (as an empty cell counts as zero).

If you specifically want to return an empty string if your 4 input cells are
all empty, you can test for that:
=IF(COUNT($B13,$C13,$E13,$G13)=0,"",IF($E130,SUM( G13/(((($E13/2)/0.0393700787)*(($E13/2)/0.0393700787)*3.14159265)*$B13/0.0393700787)),IF($E13=0,SUM(G13/(($B13/0.0393700787)*($C13/0.0393700787)*($D13/0.0393700787))),"")))
--
David Biddulph

"dim" wrote in message
...
Hi all,
I have the following function:
=IF($E130,SUM(G13/(((($E13/2)/0.0393700787)*(($E13/2)/0.0393700787)*3.14159265)*$B13/0.0393700787)),IF($E13=0,SUM(G13/(($B13/0.0393700787)*($C13/0.0393700787)*($D13/0.0393700787))),""))

All works fine when there are values filled into B,C and D13, or B & E13.
Thats great, as intended...but....when there is no value in B13,C13,D13 or
E13, I get the error #DIV/0! in my cell.

Why is the very end part of my function, the ' Otherwise "" ' [,""] not
working?

I need it to just show a blank cell when there are no numbers in B,C,D or
E13?

Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 13
Default #DIV/0! Error......why is it ignoring the ' Otherwise "" ' ?

The first part of your formula divides G13 by the product of various numbers.
If B13 is zero (or blank), this divisor will also be zero thus giving an
error. The second part (which will be evaluated if E 13 is zero or blank)
does something similar, except the divisor will be zero if *any* of B13, C13
or D13 are zero.

If you want the formula to not evaluate if any of B13, C13, D13 or E13 are
zero (or blank) then you would need something like
=If((b13*c13*d13*e13)=0,"",...)

Eric

"dim" wrote:

Hi all,
I have the following function:
=IF($E130,SUM(G13/(((($E13/2)/0.0393700787)*(($E13/2)/0.0393700787)*3.14159265)*$B13/0.0393700787)),IF($E13=0,SUM(G13/(($B13/0.0393700787)*($C13/0.0393700787)*($D13/0.0393700787))),""))

All works fine when there are values filled into B,C and D13, or B & E13.
Thats great, as intended...but....when there is no value in B13,C13,D13 or
E13, I get the error #DIV/0! in my cell.

Why is the very end part of my function, the ' Otherwise "" ' [,""] not
working?

I need it to just show a blank cell when there are no numbers in B,C,D or E13?

Any ideas?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default #DIV/0! Error......why is it ignoring the ' Otherwise "" ' ?

You don't get to your final part of the function because you've satisfied
the IF(E13=0,... condition (as an empty cell counts as zero).

If you specifically want to return an empty string if your 4 input cells
are all empty, you can test for that:
=IF(COUNT($B13,$C13,$E13,$G13)=0,"",IF($E130,SUM( G13/(((($E13/2)/0.0393700787)*(($E13/2)/0.0393700787)*3.14159265)*$B13/0.0393700787)),IF($E13=0,SUM(G13/(($B13/0.0393700787)*($C13/0.0393700787)*($D13/0.0393700787))),"")))


And, to follow up on David's posting, you can shorten your main equation by
using Excel's built-in PI() function and replacing all the divisions by
0.0393700787 with a multiplication by its reciprocal 25.4 (you are doing a
conversion involving millimeters and inches, right?). By the way, using 25.4
this way will yield an ever-so-slightly more accurate result as 25.4 is an
exact conversion value whereas 0.0393700787 is a rounded (to 10 decimal
places) one. In addition, you can remove some extraneous parentheses and
combine like terms to further simplify it. Unless I screwed the math up
somewhere (you should check to make sure I didn't), this is the final
(modification to David's posted) formula that I come up with...

=IF(COUNT($B13,$C13,$E13,$G13)=0,"",IF($E130,SUM( G13/(PI()*$B13*($E13/2)^2*25.4^3)),IF($E13=0,SUM(G13/($B13*$C13*$D13*25.4^3)),"")))

Rick

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
how to calculate average value in a row ignoring values below "x" ed both Excel Discussion (Misc queries) 3 July 25th 07 05:56 PM
Need help with formula to average numbers while ignoring "0" value mharv72 Excel Worksheet Functions 1 May 3rd 07 05:33 PM
"ignoring" hidden cells in a copy/paste operation gvm Excel Discussion (Misc queries) 2 March 22nd 07 10:38 PM
Shortcut key for "Paste Options" and "Error Checking" buttons? johndog Excel Discussion (Misc queries) 1 October 6th 06 11:56 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 02:22 PM.

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"