Thread: Formula needed
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Formula needed

On Sat, 10 Oct 2009 22:40:01 -0700, Lemmesee
wrote:

I habe a table like this:
Columns B - C are ranges between numbers.

A B C
1 15 1 5
2 9 6 10
3 19 11 21
4 20 22 30

On another sheet I need to find the range that a number is in and return
it's corresponding Value from column A
On this another sheet, If A1=1 to 5 B1 will =15
If A1=6 to 10 B1 will =9
etc....
I was trying to do it wit INDEX,MACTH,MATCH . I cant get it to work because
the second MATCH would need to have Column C in descending order.
I hope this makes sense
And thanks in advance for any help.


If your ranges are contiguous, and column B is in ascending order, as they are
in your example, then:

Sheet2!B1: =LOOKUP(A1,Sheet1!B1:B4,Sheet1!A1:A4)

The only "upper bound" test you would need would be for the ultimate upper
bound, so, in general, something like:

=IF(A1MAX(Sheet1!C:C),"Out of Bounds",LOOKUP(A1,Sheet1!B1:B4,Sheet1!A1:A4))

--ron