bob said:
I am not sure what the function of the two
dashes are (--). Can you please explain?
It's a simple question to answer.
A single negation ("-") converts a positive number to a negative number.
And vice versa; so a double negation ("--") converts any number, positive or
negative, back to itself.
The purpose of "--" here is to convert the Boolean results (true or false)
from B2:B500=A2 into numbers 0 and 1, which SUMPRODUCT requires.
But there is nothing sacrosant about "--". Including a Boolean expression
in any arithmetic expression will accomplish the same thing; that is,
converting the Boolean result into a number. That is why
(E2:E500="CT")+(E2:E500="NT") is sufficient without the use of "--".
----- original message -----