|No, there is no formula that will do what you ask.|
It's possible that it could be done with a macro, but I'm not even sure about that. Getting close is fairly easy, but hitting an exact number could take numerous, numerous, numerous iterations through the list of numbers.
Before we even go down that path, I have a question of my own:
Don't your customers tell you what they are paying for? If I sent someone $2,235.57 to pay off some invoices, I'd have come up with that number based on specific invoices. I'd tell the payee which invoices to apply the payment to. If I didn't, how could I make sure that your records matched mine?