remap fields based on numeric key table

brickbuilder

New Member
Joined
Apr 10, 2015
Messages
30
Hi, I have a table with text fields that I want to remap to a new table with numeric fields based on a 'keys' table. Example original table:

ANIMALLOCATION
dogbarn
catgarage

<tbody>
</tbody>

I want to use this keys table:

ANIMALTextKey
cat1
dog2
squirrel3
LOCATIONhouse1
barn2
garage3

<tbody>
</tbody>

To get to a new table that looks like:
ANIMALLOCATION
22
13

<tbody>
</tbody>

Any ideas please? Thank you!!
(if the keys table isn't layed out well what's a better way to lay it out?)
 
Last edited:

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Create two lookup tables, one for Animal and one for Location.
Then create a query in which you do Left Joins from your original data data to these two lookup tables, on the "name" (non-numeric) fields.
Then, just return the numerical values from the lookup tables in the query.
 
Upvote 0
Hey thanks for the response I think I can do that.
I have about 50 fields to do this with: Is your method still the most sensible way?
Thanks again
 
Upvote 0
Do you mean 50 categories, like ANIMAL, LOCATION, etc or do you mean 50 possibilities under each one?
If the the later, then yes, it does make sense to do it the way I suggested, since it only involves creating 2 lookup tables (it doesn't matter how many records are in each table).
I just want to make sure it is not a situation with 50 lookup tables, that might not be feasible.
 
Upvote 0

Forum statistics

Threads
1,221,783
Messages
6,161,940
Members
451,730
Latest member
BudgetGirl

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