View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Looking up a name in a list and returning only the column with

Think might as well use the entire cols range ($B$1:$IV$1) instead to cater
for it ..

In z,

Put instead in B1:
=IF(COLUMNS($A:A)COUNT(OFFSET(y!$B$1:$IV$1,MATCH( $A2,x!$A:$A,0)-1,)),"",INDEX(x!$B$1:$IV$1,SMALL(OFFSET(y!$B$1:$IV $1,MATCH($A2,x!$A:$A,0)-1,),COLUMNS($A:A))))

and in B2:
=IF(COLUMNS($A:A)COUNT(OFFSET(y!$B$1:$IV$1,MATCH( $A2,x!$A:$A,0)-1,)),"",INDEX(OFFSET(x!$B$1:$IV$1,MATCH($A2,x!$A:$ A,0)-1,),SMALL(OFFSET(y!$B$1:$IV$1,MATCH($A2,x!$A:$A,0)-1,),COLUMNS($A:A))))

Select B1:B2, copy across to cover the same max horiz. extent as done in y.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---