Key	Amount	Refund	Comment
101		-90.00	Cancel
101	90.00		Cancel
102	90.00		Cancel
102		-30.00	Cancel
102		-60.00	Cancel
103	90.00		Cancel
103		-90.00	Cancel
103		-25.00	
103	40.00		
104	45.00		Cancel
104	15.00		Cancel
104	45.00		
104		-60.00	Cancel
104	50.00		
105	35.00		
105		-40.00	
106	80.00		
107		-20.00	
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.