Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 202
Default what does the "- -" mean in this formula?

=SUMPRODUCT(--(Sheet1!$B$2:$B$5=Sheet1!$C11),--(Sheet1!$C$2:$C$5=E$2),Sheet1!$G$2:$G$5)

What does the "- -" mean in the formula above? This is a new formula for me
and want to be sure I fully understand how it works... the "- -" is the only
part throwing me off.

thanks for your help on this.
take care, Jane
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default what does the "- -" mean in this formula?

It just converts the thing in the parenthesis to an array of numbers rather
than an array of logicals.

See:

http://www.xldynamic.com/source/xld.SUMPRODUCT.html
--
Gary''s Student - gsnu200826


"jane" wrote:

=SUMPRODUCT(--(Sheet1!$B$2:$B$5=Sheet1!$C11),--(Sheet1!$C$2:$C$5=E$2),Sheet1!$G$2:$G$5)

What does the "- -" mean in the formula above? This is a new formula for me
and want to be sure I fully understand how it works... the "- -" is the only
part throwing me off.

thanks for your help on this.
take care, Jane

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default what does the "- -" mean in this formula?

On Jan 14, 3:27*pm, jane wrote:
=SUMPRODUCT(--(Sheet1!$B$2:$B$5=Sheet1!$C11),
--(Sheet1!$C$2:$C$5=E$2),Sheet*1!$G$2:$G$5)

What does the "- -" mean in the formula above?


It really has no special meaning. It is simply double negation. For
example, --2 is 2; ---2 is -2; ----2 is 2; etc.

However, the effect of using double negation is circumstance such as
this is to cause Excel to treat a boolean value (true or false) as a
number (1 or 0).

Using the boolean term in any arithmetic expression will have the same
effect. The above could have been rewritten without the use of double
negation, for example:

=SUMPRODUCT((Sheet1!$B$2:$B$5=Sheet1!$C11) *
(Sheet1!$C$2:$C$5=E$2), Sheet*1!$G$2:$G$5)

or even:

=SUMPRODUCT((Sheet1!$B$2:$B$5=Sheet1!$C11) *
(Sheet1!$C$2:$C$5=E$2) * Sheet*1!$G$2:$G$5)

Another alternative, returning to the original form:

=SUMPRODUCT(1*(Sheet1!$B$2:$B$5=Sheet1!$C11),
1*(Sheet1!$C$2:$C$5=E$2), Sheet*1!$G$2:$G$5)

HTH.
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
Formula to confirm entry in Col "C" is valid for data in Col "A" VAPCMD Excel Discussion (Misc queries) 2 January 2nd 09 07:58 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


All times are GMT +1. The time now is 05:42 PM.

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

About Us

"It's about Microsoft Excel"