Matrix and kilometers

Dear reader,

The Matrix below shows the distances between different cities in Poland. I have a dataset with courier services where the recipient city and sender city of the package are shown. I would like to create a formula that calculates the distance for me.

I have only come so far:

=IF(AND(A2=”WARSAW”,B2=”OLSTYN”);380;?

Then repeat over and over with differenent combinations… (very inefficient)

Is there anyway you could help? Thanks in advance! 

<!–td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}–>

City Warsaw Olsztyn Lublin Krakow Katowice Wroclaw Poznan Szczecin Gdansk Lodz
Warsaw 150 380 320 440 410 510 480 760 580 270
Olsztyn 380 180 550 700 610 670 530 680 340 450
Lublin 320 550 150 470 520 630 640 920 730 430
Krakow 440 700 470 140 200 420 650 830 740 400
Katowice 410 610 520 200 100 320 560 730 650 310
Wroclaw 510 670 630 420 320 160 350 560 710 360
Poznan 480 530 640 650 560 350 200 480 490 380
Szczecin 760 680 920 830 730 560 480 220 550 650
Gdansk 580 340 730 740 650 710 490 550 170 480
Lodz 270 450 430 400 310 360 380 650 480 130

 

 

By: Lucas

Leave a Reply

Your email address will not be published. Required fields are marked *