![]() |
|
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 12
|
I have 17 peoples' names who work for 7 different companies. I would like to be able to enter one of the names in a cell (Customer Representative)and have their company's name show up in another cell(Company). I can't figure out how to do this without using 17 nested if functions. Any suggestions would be greatly appreciated. Thanks.
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Midlands, UK
Posts: 217
|
Try the LookUp functions ( VLOOKUP, HLOOKUP ). Usually for this I'd use VLOOKUP.
Create a list of Names in Col A & their Company in Col B. You could use any columns, but the Company will have to be in a column to the right of the Name. Assuming you have the name in C1 & want the Company in D1 put the following formula in D1 : =vlookup(C1,A1:B10,2,0) A1 to B10 is the range of Names & Companies, the "2" means "when you find the match for C1 show me the value in the second column of the lookup range ie B " & the "0" means "exact matches only". HTH Iain |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,306
|
You could make a small table of names with their corresponding companies and then use a VLOOKUP.
|
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 51,549
|
Quote:
Bob Company1 Bill Company1 Rob Company3 etc. Suppose that this list is in A2:B18, you can use =VLOOKUP("Rob",$A$2:$B$18,2,0) to retieve the company a-name is associated with. You can use a cell instead of "Bob", a cell that contains a name of interest. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|