I have the above as desired output. Initially, the Comment column is empty. The goal is to tag a row 'Cancel' under the Comment column if the rows have the same key and there is/are 'Amount' that cancel out with the 'Refunds'. In the above example, the rows with key 101 cancel out each other straightforward so we tag those rows as 'Cancel'. For rows with key 102, the amount of 90 cancels out with the sum of -60 and -30 so we tag those as 'Cancel'. For rows with key 103, the amount of 90 cancels out with Refund -90 so they're tagged as 'Cancel'. But the amount of 40 and refund of -25 do not exactly cancel out each other so we do not tag them as Cancel. For rows with key 104, the amounts 45 and 15 cancel out with refund -60 so we tag them as Cancel - we did not tag as 'Cancel' the other row with amount 45 and 50. For rows with key 105, since the amount and refund values do not cancel out each other so we do not tag them. Rows with keys 106 and 107 need not be tagged as 'Cancel' too because they each have only one record. I appreciate your help.`Please Login or Register to view this content.`

## Bookmarks