![]() |
![]() |
|
|||||||
| 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: Mar 2002
Posts: 13
|
I have a text file I want to import into Excel. One of the data sets has a code for the actual data (i.e., A for apple, B for bananna, C for Grapefruit, D for Pineapple, .... U for whatever).
Is there an easy formula to covert the A, B, C, etc to the actual data value? The only way I know how to do so is: If (A2="A","Apple",if(A2="B","Bananna")) This will be rather cumbersome for letters A through U!! Thanks |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
A Apple B Bananana etc Select all of the cells of this 2-column list, go to the Name Box on the Formula Bar, type CTable (from conversion table), and hit enter. Then use the following formula: =VLOOKUP(A1,CTable,2,0) to convert the value in A1 to the value it's associated with. [ This Message was edited by: Aladin Akyurek on 2002-03-25 08:18 ] |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Leiden, The Netherlands
Posts: 68
|
Use the Lookup function for this:
=LOOKUP(A1,$D1:$E21,2,FALSE) Where A1 contains the code you want to look up (A, B, C, etc.) and $D1:$E21 contains a conversion table (the letters A through U in column D, and the words "Apple" through "Underground" in column E). Marc |
|
|
|
|
|
#4 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi, I would say a lookup table would be the best option. Let's say you put the letters in Column A and the correspoding name in Column B.
The you could use: =VLOOKUP(D2,A1:20,2,False) |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Leiden, The Netherlands
Posts: 68
|
That's right, I meant VLOOKUP!
|
|
|
|
|
|
#6 |
|
New Member
Join Date: Mar 2002
Posts: 13
|
Worked Great!!! Thanks!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|