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:
<tbody>
</tbody><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:
City Pair | Miles | KEY | GREATER |
A-B | 45 | 1 | 27 |
A-C | 15 | 2 | |
A-D | 25 | 3 | |
A-E | 40 | 4 | |
B-A | 18 | 1 | 8 |
C-A | 32 | 2 | 17 |
D-A | 25 | 3 | |
B-C | 67 | 5 | |
B-D | 23 | 6 | |
B-E | 123 | 7 | |
C-B | 80 | 5 | 13 |
D-B | 23 | 6 |
<tbody>
</tbody>
Anticipated Thanks for your support.
<strike></strike><strike></strike>