Explanation

It is surprisingly tricky to get INDEX to return more than one value to another function.

The problem is that INDEX only returns the first item in the array to the SUM function.

Similarly, this formula:

correctly returns 60, the sum of 10, 20, and 30.

Excel formula: Sum text values like numbers

Instead, INDEX delivers a full array of values to SUM.

Jeff Weir has agood explanation here on stackoverflow.

you’re free to use INDEX to retrieve individual values, or entire rows and columns.

Excel formula: Lookup and sum column

MATCH supports approximate and exact matching, andwildcards(* ?)

The N function can be used to convert TRUE and FALSE to 1 and 0 respectively.

When given a text value, the N function returns zero.

Excel formula: Sum range with INDEX

Excel INDEX function

Excel MATCH function

Excel N function