#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Double Dash

What does the double dash signify in a formula like this one I found in a
2006 post?

=SUMPRODUCT(--(X2:X500="foo"),--(Y2:Y500<100))

I've seen it muliple times and haven't quite figured it out. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Double Dash

It converts a logical value (TRUE or FALSE) into a numerical value (1 or 0)
--
Gary''s Student - gsnu200860


"Erin Searfoss" wrote:

What does the double dash signify in a formula like this one I found in a
2006 post?

=SUMPRODUCT(--(X2:X500="foo"),--(Y2:Y500<100))

I've seen it muliple times and haven't quite figured it out. Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Double Dash

J.E. McGimpsey has some notes at

http://mcgimpsey.com/excel/formulae/doubleneg.html

If this post helps click Yes
---------------
Jacob Skaria


"Erin Searfoss" wrote:

What does the double dash signify in a formula like this one I found in a
2006 post?

=SUMPRODUCT(--(X2:X500="foo"),--(Y2:Y500<100))

I've seen it muliple times and haven't quite figured it out. Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Double Dash

Perfect. Thanks.

"Gary''s Student" wrote:

It converts a logical value (TRUE or FALSE) into a numerical value (1 or 0)
--
Gary''s Student - gsnu200860


"Erin Searfoss" wrote:

What does the double dash signify in a formula like this one I found in a
2006 post?

=SUMPRODUCT(--(X2:X500="foo"),--(Y2:Y500<100))

I've seen it muliple times and haven't quite figured it out. Thanks.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default Double Dash

"Erin Searfoss" wrote:
What does the double dash signify in a formula like this one I found in a
2006 post?

=SUMPRODUCT(--(X2:X500="foo"),--(Y2:Y500<100))


Nothing special. It is simply an innocuous arithmetic operation (double
negation) that leaves the numeric result unchanged. For example, --5
= -(-5) = 5.

Some arithmetic operation is needed in order to treat the boolean result
(TRUE or FALSE) as a number (1 or 0) because SUMPRODUCT requires the latter.

But any valid arithmetic operation will have the same conversion effect.
For example, the above formula can be rewritten without "--" as:

=SUMPRODUCT((X2:X500="foo")*(Y2:Y500<100))

Reply
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
double axis, double problem (i hope only to me) kitcho Charts and Charting in Excel 1 December 30th 06 12:52 AM
dash showtunegirl Excel Worksheet Functions 3 October 4th 06 02:00 PM
What does the double dash or "--" do when using it in a function? (and other questions) CanoAko Excel Worksheet Functions 5 August 9th 06 07:21 PM
understanding dash dash in a excel formula ldebner Excel Worksheet Functions 2 October 31st 05 01:47 PM
double dash in formulas -- Ted Metro Excel Discussion (Misc queries) 4 December 29th 04 04:19 PM


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

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

About Us

"It's about Microsoft Excel"