How to create a multi column lookup list?
Hi Gabriel
on sheet2 in cell D2 enter
=VLOOKUP($A2,Sheet1!$A:$D,2,0)
This will return the Title, as it is in the second column of the range A:D
on Sheet1
If you copy this across to columns E and F , changing the number to 2 and 3
respectively, you will get the information for Author and Owner
You can make the number change automatically, by using the COLUMN()
function.
=COLUMN(B1) will return 2, COLUMN()C1) will return 3 etc.
So Substituting this in the formula
=VLOOKUP($A2,Sheet1!$A:$D,COLUMN(B1),0)
means that you can just copy the formula across and it will automatically
adjust for you.
To prevent the formula returning errors when there is nothing in column A of
sheet2, wrap it all in an IF statement
=IF(A2="","",=VLOOKUP($A2,Sheet1!$A:$D,COLUMN(B1), 0))
Copy across through E2:F2 and copy D2:F2 down the sheet as far as required.
--
Regards
Roger Govier
"Gabriel Lozano-Moran" wrote
in message ...
This is in Excel 2007.
In my 1st worksheet I have a list of books with 4 columns:
ID, Title, Authors, Owner
On a 2nd worksheet I have the following columns:
ID, Checked out to, Date
I want in the lookup list for ID in my 2nd worksheet to show the Title,
authors and owner columns but only return the ID of the book.
I can create a lookup list that contains only one column. Any ideas or
suggestions?
|