#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Formula needed

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Formula needed

Try the below in Sheet2
=IF(AND(A1=1,A1<=30),LOOKUP(A1,Sheet1!B1:B4,Sheet 1!A1:A4),"")

If this post helps click Yes
---------------
Jacob Skaria


"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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Formula needed

If you index is always a multiple of 5 (1 to 5, 6 to 10, 11 to 15) then use
Mod 5 as your index into the table. You may need to offset by 1

Use Mod(A1 - 1,5) where A5 is your input
A1 Output
1 to 5 0
6 to 10 1
11 to 15 2
16 to 20 3
21 to 25 4
26 to 30 5
"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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 31
Default Formula needed

I must have made a bad example.
I have a sheet similar to my example but it has a lot more rows and the
ranges between B & C vary but, of course, a number would be only in 1 range.
I need to lookup a value like "5" in B:C . I need to return the value
from the same row, but, in col A


"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.

  #5   Report Post  
Posted to microsoft.public.excel.misc
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel formula to copy/paste formula needed please. colwyn Excel Discussion (Misc queries) 4 October 22nd 08 11:27 PM
IF AND Formula Help Needed Karen Smith Excel Discussion (Misc queries) 7 February 11th 08 03:31 PM
needed formula Mikey[_2_] Excel Worksheet Functions 4 December 19th 07 12:56 AM
formula needed for this one... ozwunder321 Excel Worksheet Functions 2 October 29th 06 09:24 PM
Formula needed Excel Worksheet Functions 2 November 25th 05 05:07 PM


All times are GMT +1. The time now is 02:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"