You can return the row and column reference, and subtract 1 to account for the title row / column.
For X use;
=SUMPRODUCT(($B$2:$K$11=O2)*(COLUMN($B$2:$K$11)-1))
And Y;
=SUMPRODUCT(($B$2:$K$11=O2)*(ROW($B$2:$K$11)-1))