ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Use info in separate table file (https://www.excelbanter.com/excel-discussion-misc-queries/68453-use-info-separate-table-file.html)

MnO

Use info in separate table file
 

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 environmental
report and need to add information about the distance. I have a table
called "Distances" with all destination country distances available
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 to
move it to a own sheet in the calculating file.

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

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


--
MnO
------------------------------------------------------------------------
MnO's Profile: http://www.excelforum.com/member.php...o&userid=29672
View this thread: http://www.excelforum.com/showthread...hreadid=506780


vezerid

Use info in separate table file
 
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


MnO

Use info in separate table file
 

Thank you very much.

It worked out just as I wanted.


--
MnO
------------------------------------------------------------------------
MnO's Profile: http://www.excelforum.com/member.php...o&userid=29672
View this thread: http://www.excelforum.com/showthread...hreadid=506780



All times are GMT +1. The time now is 08:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com