Solved

Sumproduct Confusion

Posted on 2014-03-30
3
187 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article will show you how to use shortcut menus in the Access run-time environment.
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 demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now