Converting text variables in a cell to numeric values

EtherBoo

New Member
Joined
Oct 26, 2006
Messages
37
I'm asking this on behalf of a friend who is having trouble answering. Since we have different schedules, responses may be spread out.

I'm using Excel 2003 and I need to take data from cells and convert it to numeric value. For example, if "Alex" output "1", if "Bob" output "2", if "Carl" output "3" etc. I know the "IF" function can return the value I'm looking for if true, and if false for the first value pass it off to another nested IF function, for example, =IF(Alex,1,IF(Bob,2,IF(Carl,3,Unknown))). Unfortunately, I can only nest up to 7 IF functions, and I have 10 variables I need to convert to numeric designations. Any help on a better way of doing this would be much appreciated.

The specific data I need to convert is located in a table at http://www.feesher.com/anvil/index.php . The data I'm having a problem with is under the Yield column, the numeric designations and the text I want them to result from is listed below if this is relevant.

0 - Ultimate Wad
1 - 3W
2 - 2W/1W+3N
3 - 1W/4N
4 - 3N
5 - 2N/1N+3P
6 - 1N/4P
7 - 3P
8 - 2P
9 - 1P
10 - Epic
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
You need to utilise a lookup table.

This could either be stored in a range (as you have outlined below, lookup value in left column, value to return in second column) or you could store within a formula, ie:

=VLOOKUP(A1,AA1:AB100,2,0)

where:

A1 = value to convert
AA1:AB100 contains conversion table

within formula:

=LOOKUP(A1,{"Alex","Bob","Carl"},{1,2,3})
*Note in the above example the lookup array must be sorted in ascending order and the result array should be in accordance with the lookup array, were the values inverted (ie Alex = 3, Bob = 2, Carl = 1) then you would use:
=LOOKUP(A1,{"Alex","Bob","Carl"},{3,2,1})
as 3 is to Alex as 1 is to Carl.

I hope that points you in the right direction.
 
Upvote 0
That's me he was posting for. Thank you for your help, VLOOKUP was what I needed. I created the lookup table on another sheet and referenced it and everything worked perfectly.
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,855
Members
449,096
Latest member
Erald

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