Using a chart formulate mileage

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The subject may be a little misleading. But I'm relatively new to Excel and don't know quite how to express my question. I have a two-part travel form in an excel format. The first page contains a Destination area (FROM and TO) where I'll type in two different cities. The page has a Mileage Chart of all the different cities I would travel to and from. So basically I would look on the chart, find the mileage between the 2 destinations. How can I create a formula to get the mileage from the mileage chart(2nd page), onto the first page and after only entering the 2 destinations? Can it be done?
 
I am assuming you are talking about a table with the city names in one
vertical list and one horizontal
where the distances are in the cells. Assume the table is called
(insert>name>define) MyMiles,
the cell where you put the from city is called From and the cell with the to
city is called To
Then you can use this formula


=INDEX(MyMiles,MATCH(From,INDEX(MyMiles,,1),0),MATCH(To,INDEX(MyMiles,1,),0)
)

or if you prefer the cell ranges and the city names hard coded

=INDEX(A1:T20,MATCH("city5",A1:A20,0),MATCH("city6",A1:T1,0))

--

Regards,

Peo Sjoblom


tzamora said:
The subject may be a little misleading. But I'm relatively new to Excel
and don't know quite how to express my question. I have a two-part travel
form in an excel format. The first page contains a Destination area (FROM
and TO) where I'll type in two different cities. The page has a Mileage
Chart of all the different cities I would travel to and from. So basically
I would look on the chart, find the mileage between the 2 destinations. How
can I create a formula to get the mileage from the mileage chart(2nd page),
onto the first page and after only entering the 2 destinations? Can it be
done?
 
First of all you have to adapt the formula to the dimension of the table,
then you have to select which cell you want it in, it can't obviously be
within
the table, otherwise it is up to you. If you select the whole table first
and name
it MyMiles, then you can use the first formula when you have adapted it to.
If you also name the cells where you would put the two cities to the names I
specified the
formula should work fine. The only thing you have to do is to select 3 cells
for this,
one would hold the formula, one city1 and one city2. You could make it fancy
creating
a list somewhere off the visible area and then use data>validation in 2
cells in where
you would refer to the list and then you could select the cities from a
dropdown

--

Regards,

Peo Sjoblom

tzamora said:
Thanks for the formula, and I do have the type of chart you were assuming,
but in which cell do I input the the formula?
 
Back
Top