Assign values to text within a cell

G

Guest

I would like to know which single function I should use to assign a number
value to a chosen set of words within a cell and place the value in another
cell ie:

if worksheet1,c4 is equal to "High" then worksheet2,d17 will be 3, or
if worksheet1,c4 is equal to "Medium" then worksheet2,d17 will be 2, or
if worksheet1,c4 is equal to "Low" then worksheet2,d17 will be 1
 
N

N Harkawat

on cell d17 in sheet2 type this formula
=vlookup(sheet1!c4,{"high",3;"medium",2;"low",1},2,0)

It will give N/a if the values are any other than high,medium or low
 
J

JE McGimpsey

If worksheet1 will always have one of the three values:

D17: =MATCH(Worksheet1!C4,{"Low","Medium","High"},0)

If not:

=IF(ISNA(MATCH(Worksheet1!C4,{"Low","Medium","High"},0)),"",
MATCH(Worksheet1!C4,{"Low","Medium","High"},0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top