Lookup Table

agraham216

New Member
Joined
Mar 24, 2002
Messages
15
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
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
On 2002-03-25 07:47, agraham216 wrote:
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

Make a 2-column list consisting of letters and the values that associated with them:

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
 
Upvote 0
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
 
Upvote 0
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)
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top