Use info in separate table file

M

MnO

I have a work sheet called "Transports" in this format:

Nr Weight Destination Distance TrspType
212 78 Brazil xxx Air
233 199 Norway xxx Car
167 23 Spain xxx Boat
...

and further like this for about 500 rows.

Now I´m going to use this information to make a environmenta
report and need to add information about the distance. I have a tabl
called "Distances" with all destination country distances availabl
that look like this:

Country Distance(km)
Austria 1200
Brazil 11000
Chile 12000
Norway 700
Spain 2400
... (templates)

The table is now in a separate file, but it´s ofcourse easy t
move it to a own sheet in the calculating file.

Question: How do I make Excel to read the Country column in th
"Transport" file and then add the numbers from the "Distances" tabl
into the empty distance column in the "Transport" worksheet.

Described in simple words I want Excel to do this: Read for each lin
the destination country, and then look into the distance table to fil
the column for distances with the correct number
 
V

vezerid

Assuming your data in Transport start from A1 (header). Thus your first
formula goes to D2. Further assuming that the Distances table is in
sheet Distances, columns A:B in the same workbook (create a new sheet
and copy if necessary). Then in D2:

=VLOOKUP(C2, Distances!A:B, 2, 0)

Copy down as far as necessary.

HTH
Kostis Vezerides
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top