Assuming the above to be correct I'd be inclined to conduct a helper calculation to simplify the process...
If we assume the data is sorted by Match Pair (and nothing else) then using your sample:
At which point:
The above looks worse than it is - in reality it's pretty efficient and given the data is sorted you need only conduct the calculation once per "Match Pair" [first instance] given all subsequent instances will use the same result.
The above formulae replicate the "expected" results in the sample.
Obviously use of Column J is for sake of demo. only - you can move this calculation as you see fit, however, you must remember to adjust references in the Col F calculation accordingly.
Bookmarks