G Guest Dec 12, 2003 #1 I want to have a simple formula with text equaling a certain number Light (text) = 1 Medium(text)=2 Heavy(text)=3
I want to have a simple formula with text equaling a certain number Light (text) = 1 Medium(text)=2 Heavy(text)=3
P Peo Sjoblom Dec 12, 2003 #2 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
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
G Gord Dibben Dec 12, 2003 #3 Phil With text in A1 enter this in B1 =IF(A1="light",1,IF(A1="medium",2,3)) Gord Dibben Excel MVP
R Ron Rosenfeld Dec 12, 2003 #4 I want to have a simple formula with text equaling a certain number Light (text) = 1 Medium(text)=2 Heavy(text)=3 Click to expand... 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
I want to have a simple formula with text equaling a certain number Light (text) = 1 Medium(text)=2 Heavy(text)=3 Click to expand... 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