ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   What does -- symbol mean in an excel formulae eg: SUMPRODUCT(--(A1:A10="Luke (https://www.excelbanter.com/excel-discussion-misc-queries/449281-what-does-symbol-mean-excel-formulae-eg-sumproduct-a1-a10%3D-luke.html)

[email protected]

What does -- symbol mean in an excel formulae eg: SUMPRODUCT(--(A1:A10="Luke
 
Consider the formulae =SUMPRODUCT(--(A1:A10="Luke Skywalker"),--(B1:B10="West"),D1:D10)

What does -- mean in front of --(A1:A10="Luke Skywalker")
and --(B1:B10="West")

Claus Busch

What does -- symbol mean in an excel formulae eg: SUMPRODUCT(--(A1:A10="Luke Skywalker"),--(B1:B10="West"),D1:D10)
 
Hi,

Am Fri, 20 Sep 2013 10:48:28 -0700 (PDT) schrieb :

Consider the formulae =SUMPRODUCT(--(A1:A10="Luke Skywalker"),--(B1:B10="West"),D1:D10)

What does -- mean in front of --(A1:A10="Luke Skywalker")
and --(B1:B10="West")


-- changes TRUE to 1 and FALSE to 0 so that SUMPRODUCT can calculate the
values. You can see it if you select a cell with that formula and choose
Formula = Formula auditing


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

joeu2004[_2_]

What does -- symbol mean in an excel formulae eg: SUMPRODUCT(--(A1:A10="Luke Skywalker"),--(B1:B10="West"),D1:D10)
 
"Claus Busch" wrote:
Am Fri, 20 Sep 2013 10:48:28 -0700 (PDT) schrieb :
Consider the formulae
=SUMPRODUCT(--(A1:A10="Luke Skywalker"),--(B1:B10="West"),D1:D10)
What does -- mean in front of --(A1:A10="Luke Skywalker")
and --(B1:B10="West")


-- changes TRUE to 1 and FALSE to 0 so that SUMPRODUCT can
calculate the values.


But note that there is nothing sacrosanct about double-negative (--). Any
arithmetic operation will treat TRUE and FALSE as the numbers 1 and 0.

So, for example, s.b.bhor's formula could be written:

=SUMPRODUCT((A1:A10="Luke Skywalker")*(B1:B10="West"),D1:D10)

Many people do not realize that. So they add double-negative unnecessarily,
to wit:



=SUMPRODUCT(--(A1:A10="Luke Skywalker")*(B1:B10="West"),D1:D10)



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com