I need a formula (possibly an array?) that adds up dollar amounts that have the same reference number adjacent to them and then does the same thing for for another two columns of data that would have the same references but different dollar amounts and have those numbers subtracted from the original set of data and if they = 0 then have the data in both sets of data (ie all four columns) clear. So for instance in column A I have a reference such as KP123456 then in column B I have dollar amounts that correspond to those references. In column D I have what could be those same references (which means they are related to the references in column A) but the column D references also have different dollar amounts in column E that are associated with the refs in column D but may not be the same as the amounts in column B. Example in cells A1, A2, D1 and D2 are the reference KP123456, Cell B1= $400.00, B2=$200, E1=$100.00, and E2=$500.00. the formula should see that two references in column A matches eachother and add the dollar amounts associated with them, then check column D for refs that match the column A refs and, subtract those dollar amounts from the total value of the column E dollar amounts. Since the difference would = 0 ((400 + 200) - (500 + 100)) in the example I gave the data in all 8 cells should be cleared or marked in some way so I can manually delete them myself. Thanks.