Reverse Link

RCU61

New Member
Joined
Dec 14, 2016
Messages
5
Hello,
I would like to ask for your kind support in solving my not so easy problem.
Given
City A – City Z distance in miles (one way, by car)
City Z – City A distance in miles (the other way, bytrain)

Ask:
For any given city pairs, find
1. If the A2Z has a counterpart Z2A

2. If there is one, then:
2.1 Enter the same unique identifier in KEY column for both A2Z and Z2A city pairs
2.2 If A2Z distance = Z2A distance, then do nothing
2.3 If A2Z distance > Z2A distance, enter A2Z minus Z2A miles delta into GREATER column for A2Z
2.4 If A2Z distance < Z2A distance, enterZ2A minus A2Z miles delta into GREATER column for Z2A <z2a font="" z2a<="" for="" column="" greater="" into="" delta="" miles="" a2z="" minus="" z2a="" enter="" distance,=""></z2a>

3. If there is none, then enter a unique identifier in KEY columnfor that city pair.

I tried IF/INDEX/MATCH but I got stuck

Please provide your suggestions at least for item #1.

Example:
[TABLE="width: 192"]
<tbody>[TR]
[TD="align: center"]City Pair
[/TD]
[TD="align: center"]Miles
[/TD]
[TD="align: center"]KEY
[/TD]
[TD="align: center"]GREATER[/TD]
[/TR]
[TR]
[TD="align: center"]A-B[/TD]
[TD="align: center"]45[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]27[/TD]
[/TR]
[TR]
[TD="align: center"]A-C[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]A-D[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]A-E[/TD]
[TD="align: center"]40[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]B-A[/TD]
[TD="align: center"]18[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]8[/TD]
[/TR]
[TR]
[TD="align: center"]C-A[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]17[/TD]
[/TR]
[TR]
[TD="align: center"]D-A[/TD]
[TD="align: center"]25[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]B-C[/TD]
[TD="align: center"]67[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]B-D[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]B-E[/TD]
[TD="align: center"]123[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]C-B[/TD]
[TD="align: center"]80[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]13[/TD]
[/TR]
[TR]
[TD="align: center"]D-B[/TD]
[TD="align: center"]23[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
<strike></strike>

Anticipated Thanks for your support.

<strike></strike><strike></strike>
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,224,823
Messages
6,181,170
Members
453,021
Latest member
Justyna P

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
Back
Top