What does -- symbol mean in an excel formulae eg: SUMPRODUCT(--(A1:A10="Luke

S

s.b.bhor

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")
 
C

Claus Busch

Hi,

Am Fri, 20 Sep 2013 10:48:28 -0700 (PDT) schrieb (e-mail address removed):
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.
 
J

joeu2004

Claus Busch said:
Am Fri, 20 Sep 2013 10:48:28 -0700 (PDT) schrieb (e-mail address removed):

-- 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)
 
Joined
Apr 6, 2014
Messages
1
Reaction score
0
This -- was formulae written by Nivrutti Patil very carefully scripted plan indeed :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top