Text = a number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to have a simple formula with text equaling a certain number
Light (text) = 1
Medium(text)=2
Heavy(text)=3
 
One way

=IF(A1="","",VLOOKUP(A1,{"Light",1;"Medium",2;"Heavy",3},2,0))

that means if you type in heavy it will return 3, if you meant the opposite
switch places between the text and the numbers
 
Phil

With text in A1 enter this in B1 =IF(A1="light",1,IF(A1="medium",2,3))

Gord Dibben Excel MVP
 
I want to have a simple formula with text equaling a certain number
Light (text) = 1
Medium(text)=2
Heavy(text)=3

Perhaps:

=CHOOSE(A1,"Light","Medium","Heavy")

where your number is in A1?

Or, if you mean to type in Light, Medium or Heavy and have the number come up:

=MATCH(A1,{"Light","Medium","Heavy"},FALSE)

In both cases, you need to specify what you want to happen if A1 contains none
of the numbers (or words).


--ron
 
Back
Top