#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Sumproduct error

I have a problem with my sumproduct formula. The formula returns the correct
information if the range is filled in, but if the range is not filled in and
the cells in that range are empty, I get an error message. How do I get it to
return the correct amount even if all the cells in the range are not filled
in?

Here is my formula I am using:

=SUMPRODUCT((Zone=B8)*(O2scfm0)*(O2scfm*diversity ))

Zone is a range of cells from $C$5:$C161 it seems to happen in each of the
ranges I have. even if I change the ranges to actual $C$5......etc then it
stills gives error.

any ideas on how to return a correct number?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 915
Default Sumproduct error

John Gregory wrote:
I have a problem with my sumproduct formula. The formula returns the correct
information if the range is filled in, but if the range is not filled in and
the cells in that range are empty, I get an error message. How do I get it to
return the correct amount even if all the cells in the range are not filled
in?

Here is my formula I am using:

=SUMPRODUCT((Zone=B8)*(O2scfm0)*(O2scfm*diversity ))

Zone is a range of cells from $C$5:$C161 it seems to happen in each of the
ranges I have. even if I change the ranges to actual $C$5......etc then it
stills gives error.

any ideas on how to return a correct number?


I can't reproduce an error. One observation: the three ranges (named or
explicit) must have the same dimensions. What error do you get?
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default Sumproduct error

"John Gregory" wrote:
The formula returns the correct
information if the range is filled in, but if the range is not filled in
and the cells in that range are empty, I get an error message.
[....]
=SUMPRODUCT((Zone=B8)*(O2scfm0)*(O2scfm*diversity ))


Try:

=SUMPRODUCT((Zone=B8)*(O2scfm0), O2scfm, diversity)

Explanation: SUMPRODUCT ignores cells with text in ranges that are
individual parameters. But if those text cells are encountered in
evaluating an arithmetic operation such as "*", they cause an error.

The form (...)*(...) is useful when to write "co-conditions", i.e.
conditional expressions that both must be true. Not only does the
multiplication (*) "and" the conditionals, but also it converts them to
numbers (0 or 1), which SUMPRODUCT requires.

However, the form expr*expr is not needed for the sum of products of values,
the actual result of SUMPRODUCT. It is sufficient to write expr,expr --
separate parameters -- since SUMPRODUCT performs the multiplication.

Note: The cells causing the problem are not "empty". Truly empty cells
(i.e. no value or formula) do not cause problems in arithmetic expressions.
The cells probably contain the null string (""), for example the result of a
formula like =IF(condition, "", expression)


----- original message -----

"John Gregory" wrote in message
...
I have a problem with my sumproduct formula. The formula returns the
correct
information if the range is filled in, but if the range is not filled in
and
the cells in that range are empty, I get an error message. How do I get it
to
return the correct amount even if all the cells in the range are not
filled
in?

Here is my formula I am using:

=SUMPRODUCT((Zone=B8)*(O2scfm0)*(O2scfm*diversity ))

Zone is a range of cells from $C$5:$C161 it seems to happen in each of the
ranges I have. even if I change the ranges to actual $C$5......etc then it
stills gives error.

any ideas on how to return a correct number?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22
Default Sumproduct error

that seems to work - thanks!!

"JoeU2004" wrote:

"John Gregory" wrote:
The formula returns the correct
information if the range is filled in, but if the range is not filled in
and the cells in that range are empty, I get an error message.
[....]
=SUMPRODUCT((Zone=B8)*(O2scfm0)*(O2scfm*diversity ))


Try:

=SUMPRODUCT((Zone=B8)*(O2scfm0), O2scfm, diversity)

Explanation: SUMPRODUCT ignores cells with text in ranges that are
individual parameters. But if those text cells are encountered in
evaluating an arithmetic operation such as "*", they cause an error.

The form (...)*(...) is useful when to write "co-conditions", i.e.
conditional expressions that both must be true. Not only does the
multiplication (*) "and" the conditionals, but also it converts them to
numbers (0 or 1), which SUMPRODUCT requires.

However, the form expr*expr is not needed for the sum of products of values,
the actual result of SUMPRODUCT. It is sufficient to write expr,expr --
separate parameters -- since SUMPRODUCT performs the multiplication.

Note: The cells causing the problem are not "empty". Truly empty cells
(i.e. no value or formula) do not cause problems in arithmetic expressions.
The cells probably contain the null string (""), for example the result of a
formula like =IF(condition, "", expression)


----- original message -----

"John Gregory" wrote in message
...
I have a problem with my sumproduct formula. The formula returns the
correct
information if the range is filled in, but if the range is not filled in
and
the cells in that range are empty, I get an error message. How do I get it
to
return the correct amount even if all the cells in the range are not
filled
in?

Here is my formula I am using:

=SUMPRODUCT((Zone=B8)*(O2scfm0)*(O2scfm*diversity ))

Zone is a range of cells from $C$5:$C161 it seems to happen in each of the
ranges I have. even if I change the ranges to actual $C$5......etc then it
stills gives error.

any ideas on how to return a correct number?



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 915
Default Sumproduct error

JoeU2004 wrote:
"John Gregory" wrote:
The formula returns the correct
information if the range is filled in, but if the range is not filled in
and the cells in that range are empty, I get an error message.
[....]
=SUMPRODUCT((Zone=B8)*(O2scfm0)*(O2scfm*diversity ))


Try:

=SUMPRODUCT((Zone=B8)*(O2scfm0), O2scfm, diversity)

Explanation: SUMPRODUCT ignores cells with text in ranges that are
individual parameters. But if those text cells are encountered in
evaluating an arithmetic operation such as "*", they cause an error.

The form (...)*(...) is useful when to write "co-conditions", i.e.
conditional expressions that both must be true. Not only does the
multiplication (*) "and" the conditionals, but also it converts them to
numbers (0 or 1), which SUMPRODUCT requires.

However, the form expr*expr is not needed for the sum of products of
values, the actual result of SUMPRODUCT. It is sufficient to write
expr,expr -- separate parameters -- since SUMPRODUCT performs the
multiplication.

Note: The cells causing the problem are not "empty". Truly empty cells
(i.e. no value or formula) do not cause problems in arithmetic
expressions. The cells probably contain the null string (""), for
example the result of a formula like =IF(condition, "", expression)


Excellent exposition, explanation and solution, JoeU2004. In early times
I adopted the notation

SUMPRODUCT(--(cond1),--(cond2),...)

but for whatever reason I became "lazy" and started writing

SUMPRODUCT(cond1*cond2*...)

This example gives good reasons why one needs to be careful.

Nice post, Sir.


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default Sumproduct error

"smartin" wrote:
In early times I adopted the notation
SUMPRODUCT(--(cond1),--(cond2),...)
but for whatever reason I became "lazy" and started writing
SUMPRODUCT(cond1*cond2*...)
This example gives good reasons why one needs to be careful.


I think you misunderstood my posting. This is nothing lazy, not wrong with
SUMPRODUCT((cond1)*(cond2)*...).

The purpose of writing --(cond1) is to convert TRUE and FALSE to 1 and 0,
which SUMPRODUCT requires.

But any arithmetic operation has the same effect.

SUMPRODUCT(--(cond1),--(cond2),...) is effectively the same as
SUMPRODUCT((--(cond1))*(--(cond2)),...). SUMPRODUCT((cond1)*(cond2),...) is
just a simplication of that.

The issue I was talking about is not with the conditional expressions, but
with the arithmetic expressions.

For example, for SUMPRODUCT((A1:A100)*(B1:B10<0), C1:C10 * D1:D10), the
potential problem is with C1:C10 * D1:D10.

If any of C1:C10 or D1:D10 can be text, that form will results in a #VALUE
error.

It is more reliable to write SUMPRODUCT((A1:A100)*(B1:B10<0), C1:C10,
D1:D10) because SUMPRODUCT "treats array entries that are not numeric as if
they were zeros" (from the help page).


----- original message ----

"smartin" wrote in message
...
JoeU2004 wrote:
"John Gregory" wrote:
The formula returns the correct
information if the range is filled in, but if the range is not filled in
and the cells in that range are empty, I get an error message.
[....]
=SUMPRODUCT((Zone=B8)*(O2scfm0)*(O2scfm*diversity ))


Try:

=SUMPRODUCT((Zone=B8)*(O2scfm0), O2scfm, diversity)

Explanation: SUMPRODUCT ignores cells with text in ranges that are
individual parameters. But if those text cells are encountered in
evaluating an arithmetic operation such as "*", they cause an error.

The form (...)*(...) is useful when to write "co-conditions", i.e.
conditional expressions that both must be true. Not only does the
multiplication (*) "and" the conditionals, but also it converts them to
numbers (0 or 1), which SUMPRODUCT requires.

However, the form expr*expr is not needed for the sum of products of
values, the actual result of SUMPRODUCT. It is sufficient to write
expr,expr -- separate parameters -- since SUMPRODUCT performs the
multiplication.

Note: The cells causing the problem are not "empty". Truly empty cells
(i.e. no value or formula) do not cause problems in arithmetic
expressions. The cells probably contain the null string (""), for example
the result of a formula like =IF(condition, "", expression)


Excellent exposition, explanation and solution, JoeU2004. In early times I
adopted the notation

SUMPRODUCT(--(cond1),--(cond2),...)

but for whatever reason I became "lazy" and started writing

SUMPRODUCT(cond1*cond2*...)

This example gives good reasons why one needs to be careful.

Nice post, Sir.


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
Sumproduct DIV/0 Error D Whitney Excel Worksheet Functions 4 April 3rd 09 06:53 PM
SUMPRODUCT Error Kate Excel Discussion (Misc queries) 5 June 25th 08 02:37 PM
SUMPRODUCT #VALUE! error Chris Slowe Excel Worksheet Functions 2 June 19th 07 05:00 PM
Sumproduct error nospaminlich Excel Worksheet Functions 0 March 1st 05 06:48 PM
Sumproduct #num error Dominique Feteau Excel Worksheet Functions 2 December 19th 04 09:43 PM


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