Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 287
Default General Sumproduct Question

When using Sumproduct as a multiple criteria sumif function, I've seen it
used two ways:

sumproduct(()*()*())

sumproduct(--(),--(),())

My question is are these just two ways of doing the same thing, or does one
do something the other does not?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,069
Default General Sumproduct Question

Essentially, both ways are coercing the TRUE/FALSE result of each criteria to
be 1 (for TRUE) or 0 (for FALSE). Here is a link to a great tutorial on
SumProduct. It will answer your question in mucj more detail.

http://www.xldynamic.com/source/xld.SUMPRODUCT.html

Hope this helps,

Hutch

"Aaron" wrote:

When using Sumproduct as a multiple criteria sumif function, I've seen it
used two ways:

sumproduct(()*()*())

sumproduct(--(),--(),())

My question is are these just two ways of doing the same thing, or does one
do something the other does not?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,091
Default General Sumproduct Question

The -- takes a logical value of TRUE or FALSE and makes the value 1 or 0.
The first - coerces Excel to make the logical value for TRUE numeric,
i.e. -1. The second - makes the -1 positive - ie. 1. FALSE becomes 0 which
is neither negative or positive. Then SUMPRODUCT multiplies the resulting
values by the rest of the arguments. The format with the * will cause Excel
to make logical values numeric. TRUE becomes 1 and FALSE becomes 0. Then the
multiplication is done. The effect of the two formulas is the same. Some
people prefer one version over the other. SUMPRODUCT can also add, subtract,
divide and exponentiate.

Tyro

"Aaron" wrote in message
...
When using Sumproduct as a multiple criteria sumif function, I've seen it
used two ways:

sumproduct(()*()*())

sumproduct(--(),--(),())

My question is are these just two ways of doing the same thing, or does
one
do something the other does not?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default General Sumproduct Question

Yes, they certainly do.

Imagine this data

Id Date Amt1 Amt2 Amt3
X 01-Jan 19 13 19
Y 03-Feb 18 20 20
X 01-Feb 18 20 18


Try the two formula and see what happens

=SUMPRODUCT(--(A1:A4="X"),--(C1:C410),C1:C4)

and

=SUMPRODUCT((A1:A4="X")*(C1:C410)*(C1:C4))

Then conversely, try these two

=SUMPRODUCT(--(A2:A4="X"),--(MONTH(B2:B4)=1),C2:E4)

and

=SUMPRODUCT((A2:A4="X")*(MONTH(B2:B4)=1)*(C2:E4))

Horses for courses.


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Aaron" wrote in message
...
When using Sumproduct as a multiple criteria sumif function, I've seen it
used two ways:

sumproduct(()*()*())

sumproduct(--(),--(),())

My question is are these just two ways of doing the same thing, or does
one
do something the other does not?



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
General Question Jared Jenner Excel Discussion (Misc queries) 2 July 20th 06 05:56 PM
General Question Jared Jenner Excel Discussion (Misc queries) 1 July 18th 06 08:14 PM
General Question Me Excel Discussion (Misc queries) 3 January 12th 06 12:55 PM
General Question Easydoesit Excel Worksheet Functions 1 June 19th 05 07:14 AM
General chart set up question yellowrose Charts and Charting in Excel 3 February 22nd 05 07:57 PM


All times are GMT +1. The time now is 08:48 PM.

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

About Us

"It's about Microsoft Excel"