A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

=SUMPRODUCT(--(TRIM(A1:A10)"")), what does the "--" mean?



 
 
Thread Tools Display Modes
  #1  
Old August 28th, 2008, 07:50 AM posted to microsoft.public.excel.worksheet.functions
ray
external usenet poster
 
Posts: 475
Default =SUMPRODUCT(--(TRIM(A1:A10)"")), what does the "--" mean?

Hi,

What does the "--" operator mean in the above worksheet equation?

Thanks.

  #2  
Old August 28th, 2008, 08:00 AM posted to microsoft.public.excel.worksheet.functions
David Biddulph
external usenet poster
 
Posts: 8,714
Default =SUMPRODUCT(--(TRIM(A1:A10)"")), what does the "--" mean?

Google for "double unary minus".
--
David Biddulph

"Ray" wrote in message
news
Hi,

What does the "--" operator mean in the above worksheet equation?

Thanks.



  #3  
Old August 28th, 2008, 08:05 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default =SUMPRODUCT(--(TRIM(A1:A10)"")), what does the "--" mean?

=SUMPRODUCT(--(TRIM(A1:A10)""))

This portion will return an array of TRUE or FALSE:

TRIM(A1:A10)"")

The double unary "--" coerces these logical values to numeric values which
SUMPRODUCT can then add up to arrive at the result.

--TRUE gets coerced to 1
--FALSE gets coerced to 0

Try entering these formulas and see what happens:

=--TRUE
=--FALSE

Enter the number 10 in cell A1 then try this formula:

=--(A1=10)

--
Biff
Microsoft Excel MVP


"Ray" wrote in message
news
Hi,

What does the "--" operator mean in the above worksheet equation?

Thanks.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


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