I am trying to count all the values in column B that are greater than column C (on the same row) i.e B2 vs C2, B3 vs C3, B4 vs C4, the actual columns will change dynamically and I thought to use MATCH (as below) to identify column.

I had hoped following formula would work to avoid using INDIRECT and trying to keep it relatively simple as I will be evaluating thousands of rows of data.

=SUMPRODUCT(--(Index(tableA,0,match(A2,tableA[#Headers],0))> Index(tableA,0,match(NameXYZ,tableA[#Headers],0))))

Any suggestions gratefully received.