microsoft excel – COUNTIF across multiple sheets does not work with SUMPRODUCT

I have the two sheets below.

enter image description here

enter image description here

(The example table above is highly simplified for this question)

I’m trying to write a command that adds the total occurrences of A under the year 2017 (Answer is 3).

This formula works if I add two COUNTIFs together for each sheet:

=COUNTIF(INDEX(Sheet2!A2:C4, 0, MATCH(2017, Sheet2!A2:C2, 0)), "A") + COUNTIF(INDEX(Sheet3!A2:C4, 0, MATCH(2017, Sheet3!A2:C2, 0)), "A")

I tried to combine them into a single formula below. However I’m getting a #Value error. “Sheets” is a named range consisting of {Sheet2, Sheet3}.

=SUMPRODUCT(COUNTIF(INDEX(INDIRECT("'"&Sheets&"'!"&"A2:C4"), 0, MATCH(2017, INDIRECT("'"&Sheets&"'!"&"A2:C2"), 0)), "A"))

Why is the above formula giving me an error when I try to use the named range?