Match 1 Value within Multiple Ranges and return a corresponding value

jnslavich

New Member
Joined
Apr 27, 2011
Messages
4
ID Range1 Range2 Value1 Match
1_ 0_____ 99____ 100___ 2
2_ 100___ 199___ 150___ 2
3_ 200___ 299___ 200___ 3
4_ 300___ 399___ 300___ 4
5_ 400___ 499___ 350___ 4


What I'm looking for is a formula which will take Value1 and check to see if it is between a range named Range1 and Range2.

IF TRUE then return the corresponding ID in the Match Column, IF FALSE then move to the next row with Range1 and Range2.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
ID Range1 Range2 Value1 Match
1_ 0_____ 99____ 100___ 2
2_ 100___ 199___ 150___ 2
3_ 200___ 299___ 200___ 3
4_ 300___ 399___ 300___ 4
5_ 400___ 499___ 350___ 4


What I'm looking for is a formula which will take Value1 and check to see if it is between a range named Range1 and Range2.

IF TRUE then return the corresponding ID in the Match Column, IF FALSE then move to the next row with Range1 and Range2.
Try this...

=INDEX(A$2:A$6,MATCH(D2,B$2:B$6))

Copy down as needed.
 
Upvote 0
Try this...

=INDEX(A$2:A$6,MATCH(D2,B$2:B$6))

Copy down as needed.
ID Range1 Range2 Value1 Match
1_ 0_____ 99____ 100___ 2
2_ 100___ 199___ 150___ 2

3_ 200___ 299___ 200___ 3
4_ 300___ 399___ 300___ 4
5_ 400___ 499___ 350___ 4
6_ 500___ 599___ 700___ 2

This formula might be correct; however it returns an ID for cases where it is provably false such as the above example where Value1 has no match but it still returns an ID. In the above example on D7 there is no match, but it still returns a value.
 
Upvote 0
ID Range1 Range2 Value1 Match
1_ 0_____ 99____ 100___ 2
2_ 100___ 199___ 150___ 2
3_ 200___ 299___ 200___ 3
4_ 300___ 399___ 300___ 4
5_ 400___ 499___ 350___ 4
6_ 500___ 599___ 700___ 2

This formula might be correct; however it returns an ID for cases where it is provably false such as the above example where Value1 has no match but it still returns an ID. In the above example on D7 there is no match, but it still returns a value.
Can you show some examples?
 
Upvote 0
Can you show some examples?
ID Range1 Range2 Value1 Match
1_ 0_____ 99____ 100___ 2

2_ 100___ 199___ 150___ 2
3_ 200___ 299___ 200___ 3
4_ 300___ 399___ 300___ 4
5_ 400___ 499___ 350___ 4
6_ 500___ 599___ 700___ 2

In this table above, row 7 has been added to illustrate the example.

For Row 7, the lookup value is 700. 700 is checked to see if it falls between 0-99(False), 100-199(False), ... , and finally 500-599(False). So if there is no case where 700 fits within these range values then it should return no result. But instead returns a value from the ID column, and in this case I believe it would return a 2.
 
Upvote 0
ID Range1 Range2 Value1 Match
1_ 0_____ 99____ 100___ 2
2_ 100___ 199___ 150___ 2
3_ 200___ 299___ 200___ 3
4_ 300___ 399___ 300___ 4
5_ 400___ 499___ 350___ 4
6_ 500___ 599___ 700___ 2

In this table above, row 7 has been added to illustrate the example.

For Row 7, the lookup value is 700. 700 is checked to see if it falls between 0-99(False), 100-199(False), ... , and finally 500-599(False). So if there is no case where 700 fits within these range values then it should return no result. But instead returns a value from the ID column, and in this case I believe it would return a 2.
Try this...

Book1
ABCDE
1IDRange1Range2Value1Match
210991002
321001991502
432002992003
543003993004
654004993504
76500599700
Sheet1

Formula entered in E2 and copied down:

=IF(D2>MAX(B$2:C$7),"",INDEX(A$2:A$7,MATCH(D2,B$2:B$7)))

Or:

=IF(D2>C$7,"",INDEX(A$2:A$7,MATCH(D2,B$2:B$7)))
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top