|
How large is your real data? There may be better ways.
In the formula I suggested the 9^9 is just designed to be a number greater than any number MATCH function might return so 9^9 should work for you however large your dataset.
CHOOSE({1,2,3}.... changes depending on how many columns you have, if you have 5 columns then you need CHOOSE({1,2,3,4,5}.....and you need to include 5 MATCH functions, one for each column. CHOOSE only allows up to 29 arguments so you're limited to that many columns.
An alternative approach.....
=IF(COUNTIF(A$4:C$6,A11),INDEX(A$3:C$3,MIN(IF(A$4:C$6=A11,COLUMN(A$4:C$6)-COLUMN(A$4)+1))),"Name not listed")
confirmed with CTRL+SHIFT+ENTER
This can be more easily adapted to different amounts of data, even 100+ columns for instance
|