Macro to allocate receipt amount with invoices based on fifo method

amandeep08

Board Regular
Joined
Mar 20, 2011
Messages
130
Office Version
  1. 365
Hi,

In my workbook I have customer wise data along with Document Number, receipts amount and invoice amount. I want the Macro that will provide the result as per below approach.

I need a code which would allocate customer wise all the receipts with the Invoices serial no. wise.

If a single receipt is not sufficient to adjust a Invoice, a row is inserted and in that row the remaining balance of invoice is adjusted against next receipt. I am trying to look into this macro for the last 4 months but no one is able to help me out as of now.

I want this Macro because there are some 2K customers to whom i have to adjust the receipts every month manually.

Thanks in advance!

Sample (2) - Copy.xlsm
ABCDEFGHIJ
1Data InputRESULT
2Customer NameDoc No. Amount DescriptionS.No.CustomerInvoiceReceipt no.Receipt adjusted
3ABCA122,865ReceiptA56ABC14125A122865
4ABCA344,298InvoiceA56ABC14125D3411260
5ABCA5614,125InvoiceA34ABC4298D343065
6DEFC54950InvoiceA34ABC4298K4321233
7DEFC751,000ReceiptC54DEF950C75950
8DEFT4352,500InvoiceT435DEF2500C7550
9GDEU3453,254InvoiceT435DEF2500N354120
10GDET3466,578InvoiceU345GDE3254G6533254
11GDEG65332,352ReceiptT346GDE6578G6536578
12ABCD3414,325ReceiptJ532GDE15757G65315757
13GDEJ53215,757InvoiceP763GDE4336G6534336
14DEFN354120Receipt
15ABCK4321,433Receipt
16GDEP7634,336Invoice
17DEFB75465,432Invoice
Case
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top