Assign Values to String Value

P

PC-Renew

Hello,

I am trying to assign a numeric value to cells with string/text variables.
For instance, 10-2 would signify 4 hours... so the value I would like to
calculate would be 4. Is there an easy way to do this?


Thanks
 
M

Max

PC-Renew said:
I am trying to assign a numeric value to cells with string/text variables.
For instance, 10-2 would signify 4 hours... so the value I would like to
calculate would be 4. Is there an easy way to do this?

VLOOKUP would be, imo, the easiest.
Eg: Assume textstring in A1: 11-7
Then in B1: =VLOOKUP(A1,{"10-2",4;"10-5",7;"11-7",8},2,0)
will return 8
 
Top