Are you trying to reconcile deposits? You might be able to do this with Solver.