Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
CMAC
 
Posts: n/a
Default how to disregard the DIV in a range

2 questions

how can i get a sum formula to return a reslut when there are DIV errors in
the range?

and what does the "--" mean in this formula?
=SUMPRODUCT(--($C$11:$C$36="n"),($D$11:$D$36*P$11:P$36))

Help is greatly appreciated

c
  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Take a look at

http://www.mcgimpsey.com/excel/doubleneg.html


In article ,
"CMAC" wrote:

and what does the "--" mean in this formula?
=SUMPRODUCT(--($C$11:$C$36="n"),($D$11:$D$36*P$11:P$36))

  #3   Report Post  
JE McGimpsey
 
Posts: n/a
Default

First, good practice dictates that you should eliminate the DIV errors,
first. For instance, if your existing formulas are

=A1/B1

use

=IF(B1=0,"Invalid Data",A1/B1)

SUM() will then ignore the text.

However, you *could* work around it with (array-entered:
CTRL-SHIFT-ENTER or CMD-RETURN):

=SUM(IF(ISERR(A1:A100),"",A1:A100))



In article ,
"CMAC" wrote:

how can i get a sum formula to return a reslut when there are DIV errors in
the range?

  #4   Report Post  
CMAC
 
Posts: n/a
Default

J
Does this formula only work with a range? when i apply to two individual
cells it doesn't seem to work. i've entered it both as an array and normally
and it won't calculate divs.
=SUM(IF(ISERR(E43+E45),"",E43+E45))
cell e 43 has this in it: =IF(AVG!E43<1,1,ROUND(AVG!E43,0))
and cell e 45 has this in it:=IF(AVG!E45<1,1,ROUND(AVG!E45,0))

if i give a range of cells and enter as a formula it is fine
{=SUM(IF(ISERR(E18:E28),"",E18:E28))}.
the defined range of cells has the same formula from e43 and e45.

i have a feeling its a simple solution and one i should be embarassed about
not knowing!

thanks



"JE McGimpsey" wrote:

First, good practice dictates that you should eliminate the DIV errors,
first. For instance, if your existing formulas are

=A1/B1

use

=IF(B1=0,"Invalid Data",A1/B1)

SUM() will then ignore the text.

However, you *could* work around it with (array-entered:
CTRL-SHIFT-ENTER or CMD-RETURN):

=SUM(IF(ISERR(A1:A100),"",A1:A100))



In article ,
"CMAC" wrote:

how can i get a sum formula to return a reslut when there are DIV errors in
the range?


  #5   Report Post  
JE McGimpsey
 
Posts: n/a
Default

Yes, the array formula I gave will work only on a contiguous range.

I probably would use


E43: =MAX(ROUND(AVG!E43, 0), 1)
E45: =MAX(ROUND(AVG!E45, 0), 1)

Neither of these should ever give you a DIV/0 error by themselves, so

=E43+E45

should work as long as neither cell passes through a DIV/0 error (e.g.,
from Avg!E43 or Avg!E45).

If they are passing an error through, I'd correct the Avg!E43 and
Avg!E45 cells to avoid the error.

However, you could use

=IF(OR(ISERR(E43),ISERR(E45)),"",E43+E45)






In article ,
"CMAC" wrote:

Does this formula only work with a range? when i apply to two individual
cells it doesn't seem to work. i've entered it both as an array and normally
and it won't calculate divs.
=SUM(IF(ISERR(E43+E45),"",E43+E45))
cell e 43 has this in it: =IF(AVG!E43<1,1,ROUND(AVG!E43,0))
and cell e 45 has this in it:=IF(AVG!E45<1,1,ROUND(AVG!E45,0))

if i give a range of cells and enter as a formula it is fine
{=SUM(IF(ISERR(E18:E28),"",E18:E28))}.
the defined range of cells has the same formula from e43 and e45.

i have a feeling its a simple solution and one i should be embarassed about
not knowing!



  #6   Report Post  
JulieD
 
Posts: n/a
Default

Hi

the way i deal with DIV errors in a range to sum is to use a IF statement in
the cell generating the DIV error to suppress it along the lines of
=IF(ISERROR(original formula),0,original formula)

for a full discussion on SUMPRODUCT including the double unary (--) check
out
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
this site also has multiple examples of different ways to write a SUMPRODUCT
function with good explainations on how they work which might be worth a
read, as i'm not too sure about the format of the sumproduct function you
posted.

Hope this helps
Cheers
JulieD


for details on how sumproduct function
"CMAC" wrote in message
...
2 questions

how can i get a sum formula to return a reslut when there are DIV errors
in
the range?

and what does the "--" mean in this formula?
=SUMPRODUCT(--($C$11:$C$36="n"),($D$11:$D$36*P$11:P$36))

Help is greatly appreciated

c



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
ClearContents method on a passed range bryan New Users to Excel 2 January 19th 05 08:49 AM
range names Pedro Excel Worksheet Functions 2 January 18th 05 03:38 AM
Defined range difficulty Pat Excel Discussion (Misc queries) 7 January 16th 05 09:52 PM
named range refers to: in a chart Spencer Hutton Excel Discussion (Misc queries) 1 December 14th 04 10:15 PM
range names Pedro Excel Worksheet Functions 0 November 9th 04 06:26 PM


All times are GMT +1. The time now is 11:47 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"