Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Range value lookup

Posted on 2013-11-19
2
Medium Priority
?
246 Views
Last Modified: 2013-11-19
Hi,

I have a range such as this

ID start          ID End
1200              1299
1300              1399
1400              1499
1500              1599
1600              1699

Now I have an ID say 1378

How do I lookup this id in the range above using formulas?

Thanks!
0
Comment
Question by:Shanan212
  • 2
2 Comments
 
LVL 23

Accepted Solution

by:
NBVC earned 2000 total points
ID: 39660576
Assuming that data is in A2:B6, and your lookup value of 1378 is in E2, this will tell you the row number within that range that the number falls in:

=MATCH(1,INDEX(($A$2:$A$6<=E2)*($B$2:$B$6>=E2),0),0)

You can wrap and INDEX() around to get corresponding date in same row.

e.g.

=INDEX($C$2:$C$6,MATCH(1,INDEX(($A$2:$A$6<=E2)*($B$2:$B$6>=E2),0),0))
0
 
LVL 23

Expert Comment

by:NBVC
ID: 39660583
Or actually simpler:

=MATCH(E2,$A$2:$A$6)

since they are listed in ascending order and no gaps in ranges.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question