ThrottleWorks
Excel Ninja
Hi everyone,
Hope you are enjoying your Sunday !
I have a file. This file has around 20 columns.
Number of rows are not fixed. From these 20 columns only 9 columns are importance from coding aspect.
That is why my sample book consists only those columns.
Please refer to Input sheet for dummy data, output sheet has possible answer.
Each row represent a submission. This submission can be from my side or from opposite side.
Column A has unique identifier. This will be never repeated.
Refs in column B and C can be present multiple times.
In the attached example, row 2 and row 5 are best possible pairs.
In my example, B2 = C5 and C2 = B5, this is the first condition. If these are matching then only I can proceed. Else cannot be considered as a pair.
In short, both refs has be a match.
For the same reason, row 2 and row 9 cannot be a match cause, C2 <> B9.
Now coming back to the matched pair, once we have match ref, we will proceed.
D2 = E5, E2 = D5, F2 = G5, H2 = H5
Only un-matched are, G2 (200) <> F5 (205) and I2 (1.001) and I5 (1.003).
If you check row, 6, only difference is F6 (210).
Since the difference between G2 and F5 is less than G2 and F6, I will consider row 2 and 5 as a pair.
Same case goes for row 12 and 13, there is difference between S Currency and Rate, however B Amt and S Amt are perfect match.
Though row 13 and 14 are matching on everything except S Amt, we will not consider these for pairing against row 12.
I tried a macro, but it turned out to be spaghetti code ! cannot post now. On a different machine.
Tried various concats and combinations but somehow I am not able to do it.
Can anyone please help me in this.
Hope you are enjoying your Sunday !
I have a file. This file has around 20 columns.
Number of rows are not fixed. From these 20 columns only 9 columns are importance from coding aspect.
That is why my sample book consists only those columns.
Please refer to Input sheet for dummy data, output sheet has possible answer.
Each row represent a submission. This submission can be from my side or from opposite side.
Column A has unique identifier. This will be never repeated.
Refs in column B and C can be present multiple times.
In the attached example, row 2 and row 5 are best possible pairs.
In my example, B2 = C5 and C2 = B5, this is the first condition. If these are matching then only I can proceed. Else cannot be considered as a pair.
In short, both refs has be a match.
For the same reason, row 2 and row 9 cannot be a match cause, C2 <> B9.
Now coming back to the matched pair, once we have match ref, we will proceed.
D2 = E5, E2 = D5, F2 = G5, H2 = H5
Only un-matched are, G2 (200) <> F5 (205) and I2 (1.001) and I5 (1.003).
If you check row, 6, only difference is F6 (210).
Since the difference between G2 and F5 is less than G2 and F6, I will consider row 2 and 5 as a pair.
Same case goes for row 12 and 13, there is difference between S Currency and Rate, however B Amt and S Amt are perfect match.
Though row 13 and 14 are matching on everything except S Amt, we will not consider these for pairing against row 12.
I tried a macro, but it turned out to be spaghetti code ! cannot post now. On a different machine.
Tried various concats and combinations but somehow I am not able to do it.
Can anyone please help me in this.