# Solution to Allocating Payments Made using Min, Sumif, and Offset



## Sudhan_k (Jul 10, 2020)

Hello Members,

I am trying to put together a file to help track Incoming Products / Purchases and reconcile them to Payments made (In bulk against multiple invoices). I have used this forum, and its various topics extensively to put together a file, although some of the formulas are not straight forwards,  works great. I have run into an issue, that i'm unable to find a solution for, and would like your help.
- - - - - - - - - - - -
> I have created a List that has the Supplier Name, Invoice Value, Due Date, Total Paid Amount, and Outstanding Amount. 

> I have nearby this list, created a list that contains Supplier Name, Payment Amount, Date, and Reference. 

There are scenarios where Payments are made for the bulk of the invoice, and sometime a single invoice. I would in the Outstanding amount Column, allocate the consolidated payment across various invoices for which, though searching various forums, I have written the following formula in the Cells of Outstanding amount. This formula works beautifully, and allocates the single large payment across the invoices. However, when an excess payment is made (Advances, Payment Erros, etc.,) it does not show the excess amount (as a - negative value). I assume this is due to the min function. 

=MIN(SUMIF(List_Payment_Made[SUPPLIER],[@[SUPPLIER NAME]],List_Payment_Made[AMOUNT])-SUMIF(OFFSET(List_Payment_Reconsiliation[[#Headers],[SUPPLIER NAME]],0,0,ROW([@[SUPPLIER NAME]])-ROW(List_Payment_Reconsiliation[[#Headers],[SUPPLIER NAME]])),[@[SUPPLIER NAME]],OFFSET(List_Payment_Reconsiliation[[#Headers],[TOTAL PAID]],0,0,ROW([@[SUPPLIER NAME]])-ROW(List_Payment_Reconsiliation[[#Headers],[SUPPLIER NAME]]))),[@[INTERNAL INVOICE VALUE]])
- - - - - - - - - - - -
*Issue : I was wondering if there is way to work around this formula, so that it shows me the excess payments made as well. *
- - - - - - - - - - - -
I know that the formula would automatically adjust any excess payment into the next invoice from the supplier, but, it does not help with the reconciliation. 

Best Regards,


----------



## arrud14 (Dec 17, 2022)

How can i allocate the final paid dates for the same


----------

