Hi, glad it worked for you.
the $A$2 (absolute reference) in a formula will always stay $A$2, even when the formula is copied across or down. The A2 (relative reference) will change to A3, A4, A5 etc. when copied down. In this formula I use the absolute reference for the range I want to check. This always needs to be A2 through to A30000, so I have to use absolute referencing when I copy the formula down. But in each row, I want to compare only the value in column A in the current row, so I use A2 in row 2, and when the formula is copied down, the relative reference will be adjusted to the current row.
Now about the --
A statement like $A$2:$A$30000<A2 returns either TRUE or FALSE. If I put the -- before the statement, it will translate TRUE into 1 and FALSE into 0, so I can actually use it for calculations. The SUMPRODUCT will multiply the results of each argument.
In a formula with 7 instead of 30000 lines the part $A$2:$A$8<A2 may return {TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE}, which with the -- is then translated into {1, 1, 1, 0, 0, 0, 0}.
the next argument $B$2:$B$8>A2 may return {FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE}, which with the -- is translated into {0, 1, 1, 1, 0, 0, 0}
These two arrays will be multiplied
{1, 1, 1, 0, 0, 0, 0} *
{0, 1, 1, 1, 0, 0, 0}
the first element of the first array is multiplied with the first element of the second array, the second element of the first array is multiplied with the second element ofthe second array, etc, and the result is
{0, 1, 1, 0, 0, 0, 0}
Sumproduct then adds up these results to return 2
SUMPRODUCT is a very powerful formula, but it can take a while to internalise how it works.
hth
Bookmarks