ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   sumproduct (https://www.excelbanter.com/excel-worksheet-functions/45966-sumproduct.html)

FLKULCHAR

sumproduct
 
Why is:


=SUMPRODUCT(--(F1:F5={2,3,4,5}))

equivalent to the number of times 2,3,4, or 5 occur within the range??

thanks,

flkulchar

Aladin Akyurek

In G1 enter & copy down:

=OR(F1=2,F1=3,F1=4,F1=5)

In H1 enter & copy down:

=--G1

or

=G1+0

which are equivalent qua effect.

Now total H1:H5 with:

=SUM(H1:H5)

FLKULCHAR wrote:
Why is:


=SUMPRODUCT(--(F1:F5={2,3,4,5}))

equivalent to the number of times 2,3,4, or 5 occur within the range??

thanks,

flkulchar


--

[1] The SumProduct function should implicitly coerce the truth values to
their Excel numeric equivalents.
[2] The lookup functions should have an optional argument for the return
value, defaulting to #N/A in its absence.


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

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