Formula to get recent payment date

InvoicingNoob

New Member
Joined
Nov 6, 2024
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Invoice Amount - this is the total amount for the invoice
Payment - the amount paid

in the sample provided, Invoice #1 got an initial payment last 6/1. breakdown is 1000 was paid towards #1, 500 was paid towards #3, and 500 was paid towards #4. the second payment for Invoice #1 was paid 11/1.

Invoice #3 got the second payment in 7/1. is there a way to also get the latest date of the payment? in this case, the output that i want to show should look like this:

DateTypeAmountCompleted Payment
11/1/2024Payment1500-
10/1/2024Invoice #1150011/1/2024
9/1/2024Invoice #2100011/1/2024
8/1/2024Payment3000-
7/1/2024Invoice #335008/1/2024
6/1/2024Payment2000-
5/1/2024Invoice #1150011/1/2024
4/1/2024Invoice #335008/1/2024
3/1/2024Invoice #45006/1/2024
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Something is missing in the post. What you're describing does not what is shown in the table. Can you explain more by picking a specific example?
 
Upvote 0
of course... had to correct the table as well. apologies.

i hope i can better explain this.

we issued Invoice #1 5/1 (in bold). in the example below, the first payment for this invoice was sent 6/1 (colored blue). then, the second payment to complete the invoice was sent 11/1 (colored red).

i had this initial formula set in D2 =IF(B2="Payment","-",XLOOKUP("Payment",$B$1:B1,$A$1:A1,"-",0,-1)). what this does is it captures the payment date of the payment above the invoice.

also in the example, the items below each payment is/are the invoice/s where the payment was allocated. for example, the payment last 11/1 was allocated to Invoice #1 and Invoice #2.

so, instead of just getting the payment date above the invoices, i want to get the most recent payment date. in my database, we have several instances of invoices being paid partially.

i hope this explains it.

DateTypeAmountCompleted Payment
11/1/2024Payment1500-
5/1/2024Invoice #1150011/1/2024
9/1/2024Invoice #2100011/1/2024
8/1/2024Payment3000-
4/1/2024Invoice #335008/1/2024
6/1/2024Payment2000-
5/1/2024Invoice #1150011/1/2024
4/1/2024Invoice #335008/1/2024
3/1/2024Invoice #45006/1/2024
 
Upvote 0
Is this what you're looking for?
Book1
ABCDEFG
1DateTypeAmountCompleted PaymentInvoiceLatest Payment Date
211/1/2024Payment1500-Invoice #111/1/2024
35/1/2024Invoice #1150011/1/2024Invoice #211/1/2024
49/1/2024Invoice #2100011/1/2024Invoice #38/1/2024
58/1/2024Payment3000-Invoice #46/1/2024
64/1/2024Invoice #335008/1/2024
76/1/2024Payment2000-
85/1/2024Invoice #1150011/1/2024
94/1/2024Invoice #335008/1/2024
103/1/2024Invoice #45006/1/2024
Sheet1
Cell Formulas
RangeFormula
G2:G5G2=XLOOKUP(1,($B$2:$B$10="Payment")*(SEQUENCE(ROWS($A$2:$A$10))<XMATCH(F2,$B$2:$B$10)),$A$2:$A$10,,,-1)
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,183
Members
452,615
Latest member
bogeys2birdies

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