Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 82
Default Look up valued based on two values

In the company I work for we have group managers who are responsible for
multiple locations. Each location has a 6 digit identification number. All
of the location numbers for a specific group are within a range of values.
An example of this is that all of the locations in Alabama are numbered
between 200500 and 299500.

What I need to be able to do is match a location number within that range of
values and return the group manager's name.

The look up table looks something like this:

Start End Mgr
200500 299500 Abe Alabama
300500 399500 Gordan Gulf
400500 499500 Tom Tennessee
500500 599500 Frank Florida
600500 699500 Grant Georgia
700500 799500 Eddy East

I tried using vlookup with "TRUE" in the "range_lookup" but it didn't quite
give me the results I wanted. Example is that if I try to look up a location
like 400000 it would be a closer match with "Gordan Gulf" and should be "Tom
Tennessee".
Formula I used was: =VLOOKUP(A2,Locations!A2:$C$7,3,TRUE)

In logical terms here is what I want to do:

IF location_number =start AND location_number <= end THEN lookup
group_manager

Any help you can provide would be appreciated.

Thanks so much,

Scott

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default Look up valued based on two values

I'm a bit puzzled by your example....

You're looking up 400000, but that value sits in a gap between two ranges.
It's greater than the 300500-399500 range
but less than the 400500-499500 range

However, it looks like, for your purposes, the ranges are really
200000 299999
300000 399999
400000 499999
500000 599999
600000 699999
700000 799999

Consequently, still using your posted data in A1:C7
Start End Mgr
200500 299500 Abe Alabama
300500 399500 Gordan Gulf
400500 499500 Tom Tennessee
500500 599500 Frank Florida
600500 699500 Grant Georgia
700500 799500 Eddy East

Try something like this:
D1: 400000
E1: =INDEX(C2:C7,MATCH(E1,INDEX(ROUND(A2:A7,-4),0),1))

In this example, the formula returns Tom Tennessee

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Scott Wagner" wrote:

In the company I work for we have group managers who are responsible for
multiple locations. Each location has a 6 digit identification number. All
of the location numbers for a specific group are within a range of values.
An example of this is that all of the locations in Alabama are numbered
between 200500 and 299500.

What I need to be able to do is match a location number within that range of
values and return the group manager's name.

The look up table looks something like this:

Start End Mgr
200500 299500 Abe Alabama
300500 399500 Gordan Gulf
400500 499500 Tom Tennessee
500500 599500 Frank Florida
600500 699500 Grant Georgia
700500 799500 Eddy East

I tried using vlookup with "TRUE" in the "range_lookup" but it didn't quite
give me the results I wanted. Example is that if I try to look up a location
like 400000 it would be a closer match with "Gordan Gulf" and should be "Tom
Tennessee".
Formula I used was: =VLOOKUP(A2,Locations!A2:$C$7,3,TRUE)

In logical terms here is what I want to do:

IF location_number =start AND location_number <= end THEN lookup
group_manager

Any help you can provide would be appreciated.

Thanks so much,

Scott

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 158
Default Look up valued based on two values

One way (using your range in A1:C6 and check cell = F1- adjust for your
actual):

{=INDEX(C1:C6,MATCH(1,(A1:A6<=F1)*(B1:B6=F1),0))}

Has to be entered with Crtl-Shift-Enter.

Only thing I don't understand is why, in your example, are you looking up a
location that is not within any of the ranges? If 400000 is a valid lookup,
your ranges shouldn't start at x00500.

HTH

"Scott Wagner" wrote:

In the company I work for we have group managers who are responsible for
multiple locations. Each location has a 6 digit identification number. All
of the location numbers for a specific group are within a range of values.
An example of this is that all of the locations in Alabama are numbered
between 200500 and 299500.

What I need to be able to do is match a location number within that range of
values and return the group manager's name.

The look up table looks something like this:

Start End Mgr
200500 299500 Abe Alabama
300500 399500 Gordan Gulf
400500 499500 Tom Tennessee
500500 599500 Frank Florida
600500 699500 Grant Georgia
700500 799500 Eddy East

I tried using vlookup with "TRUE" in the "range_lookup" but it didn't quite
give me the results I wanted. Example is that if I try to look up a location
like 400000 it would be a closer match with "Gordan Gulf" and should be "Tom
Tennessee".
Formula I used was: =VLOOKUP(A2,Locations!A2:$C$7,3,TRUE)

In logical terms here is what I want to do:

IF location_number =start AND location_number <= end THEN lookup
group_manager

Any help you can provide would be appreciated.

Thanks so much,

Scott

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default THANKS!

That worked perfectly!
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
MICROSOFT VALUED PROFESSIONAL Abhishek kedia Excel Discussion (Misc queries) 1 May 9th 06 03:21 PM
Conditionally formatting highest valued cell? brett Excel Worksheet Functions 10 December 22nd 05 08:30 AM
Count unique values and create list based on these values vipa2000 Excel Worksheet Functions 7 August 5th 05 01:17 AM
lines/bar chart- on max valued bar, change color BOB-THE-K Charts and Charting in Excel 7 March 12th 05 04:29 AM
How do I subtract with text valued number instead of an actual num Crowraine Excel Worksheet Functions 15 December 17th 04 10:00 PM


All times are GMT +1. The time now is 06:44 AM.

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

About Us

"It's about Microsoft Excel"