Hi

Try this array formula

=MAX(FREQUENCY(IF(A1:H1=J1,COLUMN(A1:H1)),IF(A1:H1 <>J1,COLUMN(A1:H1))))

Where J1 houses A

HTH