...
I know it's a form of COUNTIF, but can't recall the specification of the criteria, e.g. =COUNTIF(A1:E5,"=John"), except a cell reference would be used instead of the literal 'John'. IIRC, it involved using a single or double ampersand (&)....
Might you be thinking of COUNTIFS?
The COUNTIFS equivalent of =COUNTIF($A$1:$E$5,G1) would be =COUNTIFS($A$1:$E$5,"="&G1).