Reputation: 63
How do I get multiple values with a single look up in Excel with transposing the data from column to rows.
Please see below image for how data is.
Input data:
Output data:
Upvotes: 0
Views: 127
Reputation: 34210
Alternative using INDEX/ROWS
=IFERROR(INDEX($A$2:$A$5,INT((ROWS(A$1:A1)-1)/5)+1),"")
for the name
=IFERROR(INDEX($B$2:$F$5,INT((ROWS(A$1:A1)-1)/5)+1,MOD(ROWS(A$1:A1)-1,5)+1),"")
for the number.
Upvotes: 3
Reputation: 11702
Assuming your data is in Range A2:F5
and you want output to be displayed from Cell H2
(see image from reference),
Enter following formula in Cell H2
=OFFSET($A$2,FLOOR((ROW(A2)-ROW($A$2))/5,1),0)
drag/copy down as required.
Enter the following formula in Cell I2
=OFFSET($B$2,FLOOR((ROW(B2)-ROW($B$2))/5,1),MOD(ROW(A2)-ROW($A$2),5))
drag/copy down as required.
Upvotes: 3