Assign values to text within a cell

B

Bob

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))
 
Top