Lookup function
Posted by Mike Wortman on July 20, 2001 4:41 AM
I'm trying to accomplish a very simple task and don't know the appropriate function to use. Here's what I want to do:
I want Excel to recognize a "work shift" on a schedule and return a value that represents the # of hours worked on that shift.
For example: the text string "7-6" would return a value of 11 (for an 11hr shift), "7-11" returns a value of 4, "12-8" a value of 7.5, etc.
I can accomplish it using IF,THEN statements but the formulas become very long because I have a lot of different shifts - so I thought a "lookup" table might be a more elegant solution. I have no experience with this funtion and cannot get it to consistently return the correct value. Maybe I should use MATCH or INDEX?
Here's the table I made:
shift hours
"7-11" 4
"7-3" 7.5
"6-2" 7.5
"11-7" 7.5
"12-8" 7.5
"7-6" 11
"4-8" 4
I want a formula that returns the value in th right column from the text string in the left column.
Help!