Hi,

I think we can use the following formula based approach as well.

My sample data setup is as follows. (Allocation was calculated.)

[pre]

Code:

```
Customer Receivable Allocation
A 100 100
B 125 25
A 110 110
A 285 285
A 300 5
i.e. Customer heading is in cell A1, with data in A2 onwards
Receivable is in column B
Allocation in column C
The payment data sample I used is as follows:
Customer Payment
A 500
B 25
```

[/pre]

For ease of reference in the formula, I named the payment data using Excel Names:

"PaidBy" is the data range "A"; "B" above

"Payments" is the data range "500;25" above

Allocation can be calculated as (formula shown is for cell C2):

=MIN(B2, SUMIFS(Payments, PaidBy, A2) - SUMIFS(C$1:C1, A$1:A1,A2))

It can be copied down to additional rows in column C.

Hope this helps.

Cheers,

Sajan.