LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Using "--" as an array formula shortcut / alternative

* works where comma doesn't when there are conditions. So

=SUMPRODUCT(A1:A10,B1:B10)

works fine when they are all numbers. But if you want to test for A1:A10
10 say the test

A1:A1010 returns TRUE FALSE which have to be transformed into numbers for
SUMPRODUCT to work. One way is to multiply the arrays (TRUE*1=1, FALSE*1=0),
another is to double negate it (--TRUE), another is to add 0 (TRUE+0),
another is to raise to the 0th power (TRUE^2). All of these have the effect
of transforming to a number which SUMPRODUCT is happier to work with.


--
---
HTH

Bob


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



wrote in message
...
On Feb 5, 1:12 pm, Ollie4 wrote:
so what does
sumproduct(--(A1:A1000="West"),--(B1:B1000="Blue"),C1:C1000)
deferrer from
sumproduct((A1:A1000="West")*(B1:B1000="Blue")*(C1 :C1000))?


Related question:

Why does the "*" work, but if you use "," instead you don't get the
right answer. I thought sumproduct multiplied the entries so in a
way, I thought they'd still get multiplied "the right way".

PS, thanks for the link Bob Phillips.


 
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
How to Count the number of "rows" (or Array items) included in a Sumif formula? EagleOne Excel Discussion (Misc queries) 3 July 30th 07 06:25 PM
"Type mismatch" when I try to fill an Array variable with "+" [email protected] Excel Discussion (Misc queries) 1 April 17th 07 01:28 PM
How do I use "offset" function in "array formula"? hongguang Excel Discussion (Misc queries) 3 April 4th 07 12:04 AM
Shortcut key for "Paste Options" and "Error Checking" buttons? johndog Excel Discussion (Misc queries) 1 October 6th 06 11:56 AM
Excel shortcut key "Cut" Ctrl+X come up a formula to me why? Tony Excel Discussion (Misc queries) 2 December 12th 05 06:25 AM


All times are GMT +1. The time now is 03:05 PM.

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

About Us

"It's about Microsoft Excel"