VLOOKUP addresses and their numbers and give them best return value

tasic89

New Member
Joined
Apr 12, 2021
Messages
35
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
Hi,

I have a specific problem, and I need help.

I will be getting a list of customers like this

NAMESURNAMEPLACESTREETSTREET NUMBERDELIVERY POINT
MIKEJONESLOS ANGELESPASADENA11LA 1
GEORGEMATIKLOS ANGELESPASADENA9LA 2
DERRICKSHAWNLAS VEGASPASADENA33LAS VEGAS
SASHAFINESACRAMENTOGEORGE44SAC 3


I don't want to do it manually to add the "delivery point" to specific adresses.

I want to use some fixed table like this one

PLACESTREETSTREET NUMBERDELIVERY POINT
LOS ANGELESPASADENA1LA 1
SACRAMENTOGEORGESAC 3* PASADENA 1-8 LA 1, PASADENA 9-30 LA 2, PASADENA 31-90 LA 3…
LOS ANGELESNEW ONELA 5
LOS ANGELESPASADENA6LA 1
LOS ANGELESPASADENA7LA 1
LOS ANGELESPASADENA8LA 1
LOS ANGELESPASADENA9LA 2
LOS ANGELESSHAQLA 3
LAS VEGASGAMBLELAS VEGAS
LAS VEGASPASADENALAS VEGAS


Thing is that I have several places like in this "fixed" one. And I have some rules. Like in Los Angeles and Las Vegas I have a street with the same names. But Pasadena in LA or LV will have different delivery points. Also I have additional problem in the rules that Pasadena in LA is a very long street, so 1-9 is in one store, while 10-30 is in another one. Because its better that way. In the fixed one, I have some streets without any numbers, just because the whole street is "dedicated" to one delivery point.

Is there any vlookup formulas that will bring me the desired result and that will successfully give me the right delivery point ?

p.s. Variable one is the variable, but the layout of informations is always the same. If there e.g. is some bad typed street it will give me N/A result which is fine, or maybe if I don't have that street inserted in fixed table.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Looking at the cell to the right of the bottom table, PASADENA 1-8 LA 1, PASADENA 9-30 LA 2, PASADENA 31-90 LA 3 shouldn't the first one in the top table be LA 2 instead of LA 1?

I've made a few changes to the bottom table, hopefully I've followed the requirement correctly. For L.A./ Pasadena the street numbers are the lowest for each delivery point. Street numbers for any single Place / Street combination must be in ascending order, if they are not then you could see incorrect delivery points for some entries.
Book1
ABCDEF
1NAMESURNAMEPLACESTREETSTREET NUMBERDELIVERY POINT
2MIKEJONESLOS ANGELESPASADENA11LA 2
3GEORGEMATIKLOS ANGELESPASADENA9LA 2
4DERRICKSHAWNLAS VEGASPASADENA33LAS VEGAS
5SASHAFINESACRAMENTOGEORGE44SAC 3
6
7PLACESTREETSTREET NUMBERDELIVERY POINT
8SACRAMENTOGEORGESAC 3
9LOS ANGELESNEW ONELA 5
10LOS ANGELESPASADENA1LA 1
11LOS ANGELESPASADENA9LA 2
12LOS ANGELESPASADENA31LA 3
13LOS ANGELESSHAQLA 3
14LAS VEGASGAMBLELAS VEGAS
15LAS VEGASPASADENALAS VEGAS
Sheet4
Cell Formulas
RangeFormula
F2:F5F2=LOOKUP(2,1/($A$8:$A$15=C2)/($B$8:$B$15=D2)/IF(COUNTIFS($A$8:$A$15,C2,$B$8:$B$15,D2,$C$8:$C$15,""),1,$C$8:$C$15<=E2),$D$8:$D$15)
 
Upvote 0
Solution
Hi,

Just want to say big thanks.

Your formula works perfectly.

I tested it in this few days, I have over 4000 adresses in fixed list.

I just want to add that I needed to ascend all street numbers (in "fixed" list) and in that variable list.

And also i needed to press ctrl+shift+enter in that formula. And like out of 1030 addresses, he automatically done it for 900. 130 are typos or some adresses that are "older" street names. But that's super okay, especially when I know that 900 are recognized.
 
Upvote 0
also i needed to press ctrl+shift+enter in that formula.
Sorry, I keep forgetting that. I'm using a newer version of excel that no longer needs Ctrl Shift Enter (with a couple of very rare exceptions on obscure formulas).

Glad you figured it out and got it working as needed (y)
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,209
Members
453,022
Latest member
RobertV1609

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