Hello and thanks for the help. I have seen -- in formulas and I have no idea
what that means or why the use of a double negative sign. Could someone
please explain to me when this is used and why?
Here's an example of a formula I saw using the --
=SUMPRODUCT(--($A$2:$A$30lt;gt;quot;quot;),--(TEXT($A$2:$A$30,quot;ddddquot;)=$C2),--($B$2:$B$30))
THANKS!
Sheri, here is an answer from a previous post on the subject form Chip
Pearson
One uses the double negation operators -- to change a boolean
value of TRUE or FALSE to its numeric equivalent of 1 or 0. The
first - changes TRUE to -1 and FALSE to 0, and the second change
the -1 to 1 and the 0 to 0. The sign is always preserved because
the negative of a negative is the same number.The -- is the same as multiplying what follows by -1 twice. It
is used to change comparisons which return TRUE or FALSE to their
numeric equivalents of 1 and 0.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 amp; 2003
quot;SheriTinglequot; gt; wrote in message
...
gt; Hello and thanks for the help. I have seen -- in formulas and I have no
idea
gt; what that means or why the use of a double negative sign. Could someone
gt; please explain to me when this is used and why?
gt;
gt; Here's an example of a formula I saw using the --
gt;
gt;
=SUMPRODUCT(--($A$2:$A$30lt;gt;quot;quot;),--(TEXT($A$2:$A$30,quot;ddddquot;)=$C2),--($B$2:$B$30
))
gt;
gt; THANKS!
The first minus changes true to -1 (and false to 0). The second minus changes
-1 to 1 (and 0 to 0).
=sumproduct() likes to work with numbers, so this is a quick way to change those
boolean values to numbers.
Bob Phillips explains =sumproduct() in much more detail he
www.xldynamic.com/source/xld.SUMPRODUCT.html
And J.E. McGimpsey has some notes at:
mcgimpsey.com/excel/formulae/doubleneg.html
SheriTingle wrote:
gt;
gt; Hello and thanks for the help. I have seen -- in formulas and I have no idea
gt; what that means or why the use of a double negative sign. Could someone
gt; please explain to me when this is used and why?
gt;
gt; Here's an example of a formula I saw using the --
gt;
gt; =SUMPRODUCT(--($A$2:$A$30lt;gt;quot;quot;),--(TEXT($A$2:$A$30,quot;ddddquot;)=$C2),--($B$2:$B$30))
gt;
gt; THANKS!
--
Dave Peterson
- Apr 21 Sat 2007 20:37
What is the -
close
全站熱搜
留言列表
發表留言