![]() |
|
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Feb 2003
Location: Sussex, Englandshire,UK
Posts: 759
|
Many a time I see formula suggestions from the demi gods in our midst using the SUMPRODUCT function which contain a double minus sign ("--").
Can one of the aforementioned please explain this apparent double negation. |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: May 2002
Posts: 12,819
|
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Dec 2003
Location: Oregon, USA
Posts: 9,797
|
Paddy, could you not substitute the "--" for the N fx as it also returns a numeric value? or am i off?
__________________
Regards, Zack Barresse All Excel Functions (If you would like comments in any code, please say so.) |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: San Francisco, California USA
Posts: 9,630
|
Quote:
__________________
Tom Urtis |
|
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: May 2002
Posts: 12,819
|
"Paddy, could you not substitute the "--" for the N fx as it also returns a numeric value? or am i off?"
yep, that could be used. |
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Hi,
As with many of the more novel Excel approaches, credit for this goes to Harlan Grove. I think this is the original thread that raises this issue. In typical Harlan fashion, he gets into an argument. http://www.google.com/groups?hl=en&l...%40tkmsftngp09 Harlan is unbelievably good, but also a PITA (especially if you are a certain MS MVP who has offered a number of routines to work with arrays).
__________________
Bye, Jay |
|
|
|
|
|
#7 |
|
Join Date: Jul 2002
Location: Perth, Australia
Posts: 1,416
|
Jim,
The key issue is the matter referred to by Paddy – Sumproduct …. “just need an extra step to coerce the logicals to numerics (so that sumproduct has something to sum)”. From the Help file on Sumproduct: “SUMPRODUCT treats array entries that are not numeric as if they were zeros”. If you go to the thread referred to by Paddy, and remove the double unary from the Sumproduct formula, the answer is 0 (zero). My understanding of the double unary is that the first “-” converts true/false to -1/0 (True = 1, false = 0) and the second “-” changes the sign to 1/0. Regards, Mike |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|