Vertical and Horizontal Lookup

JohnGuts

New Member
Joined
Mar 14, 2006
Messages
43
All,

I have a stadard mileage chart that has city names in the left most column, Column A (A2:A113) and the same city names along the top row, Row 1 (B1:DH1).

This is used to find the distances between two city's by finding the point where the rows and columns intersect.

What I am trying to do is have the user input a city name and find the 10 closest city's to the input city.

The query would be on a seperate sheet than the mileage data so the user input would be in cell A3 and then I would put the 10 closest cites in A5:A14. I would also need to put the mileage value in the cell next to the city name.

Not sure how to make this happen. Thanks for any help you can provide.
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,953
Office Version
365, 2010
Platform
Windows
This is done with INDEX MATCH MATCH:

Excel Workbook
ABCDEFGHI
1PortlandSalemAshlandStart CityEnd CityDistance
2Portland030150PortlandAshland150
3Salem300120
4Ashland1501200
Sheet1
 

JohnGuts

New Member
Joined
Mar 14, 2006
Messages
43
Thanks for the reply. This worked great for finding the distance between two specific cities. Any idea how I can find the 10 closest cities to a user inputted city?

Thanks again for any help you can provide.

John
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,403
Messages
5,511,154
Members
408,828
Latest member
Csmnvld

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top