Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have made this table:

          A    |     B   |    C  
     ----------|---------|---------- 
           1   |   100   |    50
         101   |   200   |    75
         201   |   300   |   100


*A = km
*B = km
*C = rs

I would like to extract value from C when users entered a value, within the range of A and B

Example:

          D    |    E   
     ----------|---------
         105   |    75   

 *D = user manual entry
 *E = result

How could I do this?

share|improve this question
    
Stop yelling. And your formatting isn't intuitively suggesting what are in the cells you're referencing. –  Solemnity Jan 24 '13 at 4:47

1 Answer 1

Use this formula in E1:

=VLOOKUP(D1,$A$1:$C$3,3)
share|improve this answer
2  
+1 for the approach but if D1 = 105 won't that return 50? Think you need to use col A as lookup range, i.e. =VLOOKUP(D1,$A$1:$C$3,3) –  barry houdini Jan 24 '13 at 16:30
    
Thanks for the comment - of course you're right. I edited the answer. –  Peter Albert Jan 24 '13 at 20:44
    
Dont know what happened - that's what I wanted to do. Done now! :-) –  Peter Albert Jan 25 '13 at 13:39
1  
+1. That should work in all the reasonable edge cases. (Although, amusingly, it's possible to have D1 return 50 by entering 100.999999999999, calculating correctly but with E1 displaying 101.) –  Jonathan Garber Jan 25 '13 at 13:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.