Solved

Sumproduct Confusion

Posted on 2014-03-30
3
192 Views
Last Modified: 2014-03-30
Hello

Can anyone explain what is that -- within the sumproduct?
SUM(--(myExpensesItems="Sugar"))

I am hard time understanding it


Thank you
0
Comment
Question by:Rayne
3 Comments
 
LVL 24

Accepted Solution

by:
mankowitz earned 250 total points
ID: 39964804
the double minus sign has the effect of forcing a value to be an int, so "true" becomes 1 and "false" becomes zero. This is very useful in sumproduct calculations because you are often multiplying one range against another, so you can use the 0 and 1's to include certain values of the range.

See http://www.k2e.com/tech-update/tips/143-using-two-minus-signs-in-excel
0
 
LVL 10

Assisted Solution

by:broro183
broro183 earned 250 total points
ID: 39964818
hi,

The "--" is called the double unary operator (aka double negative or double minus) & the first negative sign converts arrays from a True/False to a -1/0 while the second negative sign converts the -1/0 to 1/0 within the sumproduct formula.

Here are some other explanations, tips and caveats:
http://mcgimpsey.com/excel/formulae/doubleneg.html
http://xldynamic.com/source/xld.SUMPRODUCT.html
http://windowssecrets.com/forums/showthread.php/109039-sumproduct-explained-with-double-unary-operator-(2003)
http://www.teylyn.com/articles/excel-articles/sumproduct_volatile_bug/
http://www.teylyn.com/articles/excel-articles/sumproduct-error-messages/

hth
Rob
0
 

Author Closing Comment

by:Rayne
ID: 39964829
Thank you All :)
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question