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.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. 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
 

Watch MrExcel Video

Forum statistics

Threads
1,133,380
Messages
5,658,480
Members
418,446
Latest member
JValencia

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
Top