Hi all,

I have tried everything and cannot seem to figure this out.

I have 2 known (but constantly changing) values. One is a row label and the other is a value that will be in that specific row of the table. I need to make an excel formula that will look for that row, then go within that row and find the value then return the the column header.

Here is an example table:

brown gold silver
dog 1 2 3
cat 3 2 1
fly 2 3


So I want to find the row 'cat' then return the name of the header that belongs to the value 2 (ie i want my result to be gold)

Here is the formula that I currently have.. I feel like im almost there but not quite:

where in A1 I have the number 2
and B1 has cat
the entire table is in b2:k78 with c2:k2 being the headers.. (brown, gold, silver..etc) and b3:b78 being the types of animals (dog, cat, fly etc)

=LOOKUP(a1,INDEX('ranking'!$C$3:$K$78,MATCH(b1,'ranking'!$B$3:$B$78,0),0),'ranking'!C2:K2)

This will not work!! Please help me figure this out