#1   Report Post  
Posted to microsoft.public.excel.misc
LPS
 
Posts: n/a
Default Dashes in Functions

Has anyone ever seen the use of "dashes" in functions or formulas before? I
have a user who has several instances where dashes have been used (someone
sent her the spreadsheet) and none of us have ever seen this before. An
example follows:

=SUMPRODUCT(--(F3:F838<121),--(E3:E838=1))

Any suggestions / explanations?
Thanks,
--
LPS
  #2   Report Post  
Posted to microsoft.public.excel.misc
bpeltzer
 
Posts: n/a
Default Dashes in Functions

They're just minus signs. By applying a unary minus operation to a
true/false, you force Excel to turn the booleans into numbers. By applying
the minus twice, you get back to a positive number.
So --(true) is 1; --(false) is 0.

"LPS" wrote:

Has anyone ever seen the use of "dashes" in functions or formulas before? I
have a user who has several instances where dashes have been used (someone
sent her the spreadsheet) and none of us have ever seen this before. An
example follows:

=SUMPRODUCT(--(F3:F838<121),--(E3:E838=1))

Any suggestions / explanations?
Thanks,
--
LPS

  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Dashes in Functions

This expression:
F3:F838<121
expands into 836 true/falses (one for each cell in F3:F838)

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
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html



LPS wrote:

Has anyone ever seen the use of "dashes" in functions or formulas before? I
have a user who has several instances where dashes have been used (someone
sent her the spreadsheet) and none of us have ever seen this before. An
example follows:

=SUMPRODUCT(--(F3:F838<121),--(E3:E838=1))

Any suggestions / explanations?
Thanks,
--
LPS


--

Dave Peterson
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
Can I get Excel to determine the line curve formula without graph. Cadelima Excel Discussion (Misc queries) 8 December 20th 05 09:57 PM
User-defined functions created in Excel 2000 fail in Excel 2003 goodguy Excel Discussion (Misc queries) 1 October 3rd 05 07:04 PM
Database functions should use criteria in formula, as 1-2-3 does 123user Excel Worksheet Functions 8 September 29th 05 08:57 PM
Visible rows and functions that work tracy Excel Worksheet Functions 2 August 19th 05 05:25 AM
3 questions about automated c++ com add-in worksheet functions gert Excel Worksheet Functions 0 March 10th 05 09:57 AM


All times are GMT +1. The time now is 08:31 AM.

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"