Thread: Hlookup help
View Single Post
  #4  
Old 08-17-2008, 01:33 PM
daddylonglegs's Avatar
daddylonglegs daddylonglegs is online now
Forum Moderator
 
Join Date: 14 Jan 2006
Location: England
Posts: 5,174
daddylonglegs is a jewel in the rough
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
Reply With Quote