ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   =SUMPRODUCT(--(TRIM(A1:A10)<"")), what does the "--" mean? (https://www.excelbanter.com/excel-worksheet-functions/200542-%3Dsumproduct-trim-a1-a10-what-does-mean.html)

RaY

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

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

Thanks.


David Biddulph[_2_]

=SUMPRODUCT(--(TRIM(A1:A10)<"")), what does the "--" mean?
 
Google for "double unary minus".
--
David Biddulph

"Ray" wrote in message
...
Hi,

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

Thanks.




T. Valko

=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
...
Hi,

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

Thanks.





All times are GMT +1. The time now is 05:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com