I am trying to figure out how to use =countif with auto filter.

=SUMPRODUCT(SUBTOTAL(3,OFFSET(A$2,ROW(A$2:A$1000)-ROW(A$2),,1)),--(A$2:A$1000="Right"))

I have used the above formula before, and now I am getting a #REF error? I changed the A to AC in the formula to accommodate where the data resides in my new spreadsheet.. I am not good with these formulas so I am not sure what the 3, and ,,1 mean.. maybe those need to be changed too?

In my new spreadsheet.. I am posting the formula in AD1, to count AC2:ac1200, when I filter on Column B