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

I have a question about the use of Sumproduct to match multiple
conditions. While the calculations work as expected when I follow the
guide at this site:

http://www.contextures.on.ca/xlFunct...tml#SumProduct

What is the difference between SUMPRODUCT(--(A1:A10=0)) and
SUMPRODUCT((A1:A10=0))?

I am confused by the -- syntax. I have looked around and can't seem to
find any explanation for what it means. If I don't include them in my
Sumproduct calculations, the answers are incorrect. What gives?


Marc

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Sumproduct

Give this link a try...

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

Jim Thomlinson


"meckhert" wrote:

I have a question about the use of Sumproduct to match multiple
conditions. While the calculations work as expected when I follow the
guide at this site:

http://www.contextures.on.ca/xlFunct...tml#SumProduct

What is the difference between SUMPRODUCT(--(A1:A10=0)) and
SUMPRODUCT((A1:A10=0))?

I am confused by the -- syntax. I have looked around and can't seem to
find any explanation for what it means. If I don't include them in my
Sumproduct calculations, the answers are incorrect. What gives?


Marc


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sumproduct

(A1:A10=0)

Returns {True,False,True,True,False,True,True,False,True,F alse}

But what you want is {1,0,1,1,0,1,1,0,1,0}

By using the first negative sign, you converse the Boolean values to numbers
{-1,0,-1,-1,0,-1,-1,0,-1,0}

Then negating this with the second negative sign, you get what you want
{1,0,1,1,0,1,1,0,1,0}

You could see this yourself by entering the formula. then highlight
(A1:A10=0) in the formula bar and hit F9.

Now hit escape to return it to being a formula. Now select
-(A1:A10=0) and hit F9, then escape when done looking.

Now select
--(A1:A10=0) and hit F9, then escape when done looking

Using F9 to do an immediate evaluation is often handy when working with
array formulas.
--
Regards,
Tom Ogilvy


"meckhert" wrote in message
oups.com...
I have a question about the use of Sumproduct to match multiple
conditions. While the calculations work as expected when I follow the
guide at this site:

http://www.contextures.on.ca/xlFunct...tml#SumProduct

What is the difference between SUMPRODUCT(--(A1:A10=0)) and
SUMPRODUCT((A1:A10=0))?

I am confused by the -- syntax. I have looked around and can't seem to
find any explanation for what it means. If I don't include them in my
Sumproduct calculations, the answers are incorrect. What gives?


Marc



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 with Condition OR Sumproduct with ADDRESS function - HE gholly Excel Discussion (Misc queries) 2 September 28th 09 05:07 PM
Sumproduct I think GSemler Excel Worksheet Functions 1 October 20th 08 04:13 PM
Conditional SUMPRODUCT or SUMPRODUCT with Filters Ted M H Excel Worksheet Functions 4 August 14th 08 07:50 PM
sumproduct? sumif(sumproduct)? David Excel Worksheet Functions 3 July 13th 07 07:06 PM
Sumproduct #value! wal50 Excel Worksheet Functions 8 May 8th 06 09:14 PM


All times are GMT +1. The time now is 08:44 AM.

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"