Hello, this is a problem that has been giving me trouble. I was wondering if anyone on here would happen to have a solution.

I have a column of account numbers, and a column of dollar amounts, most dollar amount have a negative and positive entry.

columns are sorted by account number, then dollar amount

I need to sum all of the dollar amounts together that correspond to each individual account number.

if the sum = 0 I need to report this in a different column as "ok"

If the sum <>0 I need to isolate the items that are missing a Positive or negative entry and report them in a different column
***Here is the kicker
There is a 3rd column with a transaction number
for the items that do have a positive and negative entry the negative entry will be the next highest transaction number in relation to the account number.

*Example: Account number 123 has 3 entries with balancing entries x1 represents the positive entry with the smallest transaction number, corresponding to account number:123. x3 represents the positive entry with the largest transaction number, corresponding to account
number:123. Same logic goes for the negative entries y. So x1 matches with y1, x2 matches with y2 and x3 matches with y3. when there are no issues.
I need to know what specific entries are missing, amount is not enough, so if x2 from the previous example is missing I would need to remove x2 and know that items account number amount and transaction number, and not disrupt the other matching.

So when it’s all said and done I will have identified all of the entries that do not have a balancing entry.
Thanks in Advance!