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