MrExcel Publishing
Your One Stop for Excel Tips & Solutions

referencing data in cell


Posted by itgirl168 on January 29, 2002 10:10 AM

help please....
i have two columns....

column A column B
1 john
2 mary
3 peter

I need to have a third column that pulls column A information based on what is showing in column B. if column B = john, reflect the corresponding data in column A. The order that the names appear in column b will change regularly.

Thanks!!!


Posted by Dan Aragon on January 29, 2002 10:30 AM

First, I would swap your columns so that Column A has the names and Column B has the numbers.

Then in Cell C1 you can enter the name you are looking for and in Cell D1 you can use the formula:

=VLOOKUP(C1,A1:B3,1,0)

to lookup the corresponding number. For more information on the vlookup function, checkout the Help section of Excel. HTH.