-- before an argument

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

Was hoping someone could explain to me the reasons and it's function before an argument

"--

Thank

Alb
 
thanks Pe

So, it's actually converting a true/false result to 1/0 for addition/subtraction/ multiplication/division

So why does :=SUM((D7:D12>=20)*(D7:D12<=40)) work and why the need for

=SUMPRODUCT(--(Range>=20),--(Range<=40)

Is it because of the sumproduct instead of the sum only

Alby
 
Hi Alby!

* without the -- works OK for counting situations but not for summing
cases.

The -- is also supposed to be quicker but I've not noticed much
difference in my own limited tests.

We also use -- a lot in parsing formulas where we are trying to get a
number out of a text string. The -- converts the text string to a
number.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
Alby said:
thanks Peo

So, it's actually converting a true/false result to 1/0 for
addition/subtraction/ multiplication/division.
 
Hi Alby
for example extracting parts of a string using functions like LEFT,
MID, RIGHT.
 
A syntax check, which is a short description, i.e., a description without
tons of qualifications,
 
Hi Alby!

An explanation by way of an example:

A1 has entry:
AMD6754

If I use =RIGHT(A1,4) this is known as "parsing the entry".

But if I use =RIGHT(A1,4) the number is returned as text. To get it to
be treated as a number, I can use =--RIGHT(A1,4)

The term comes from English grammar where you take a sentence and
parse it into Noun, Proper Noun, Adjective, Verb, Adverb and all those
other bits we've spent years trying to forget.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Back
Top