Formula to lookup a date of payment

InvoicingNoob

New Member
Joined
Nov 6, 2024
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have tons of data that looks like this:

DateTypeAmount
11/1/2024Payment2500
10/1/2024Invoice1500
9/1/2024Invoice1000
8/1/2024Payment3500
7/1/2024Invoice3500
6/1/2024Payment2500
5/1/2024Invoice1000
4/1/2024Invoice1000
3/1/2024Invoice500

What I wanted to achieve is to get the payment date for each of the invoices. In the example, the invoices dated 10/1 and 9/1 were paid 11/1. Invoice dated 7/1 were paid 8/1. and so on.

Is there a way to have the formula triggered based on the Type? so, if it's payments, it will get the payment date of the row above. See sample of what I wanted to accomplish:

DateTypeAmountPayment Date
11/1/2024Payment2500-
10/1/2024Invoice150011/1/2024
9/1/2024Invoice100011/1/2024
8/1/2024Payment3500
7/1/2024Invoice35008/1/2024
6/1/2024Payment2500
5/1/2024Invoice10006/1/2024
4/1/2024Invoice10006/1/2024
3/1/2024Invoice5006/1/2024
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Try this:

Book1
ABCD
1DateTypeAmountPayment Date
211/1/2024Payment2500-
310/1/2024Invoice150011/1/2024
49/1/2024Invoice100011/1/2024
58/1/2024Payment3500-
67/1/2024Invoice35008/1/2024
76/1/2024Payment2500-
85/1/2024Invoice10006/1/2024
94/1/2024Invoice10006/1/2024
103/1/2024Invoice5006/1/2024
Sheet1
Cell Formulas
RangeFormula
D2:D10D2=IF(B2="Payment","-",XLOOKUP("Payment",$B$1:B1,$A$1:A1,"-",0,-1))
 
Upvote 0
Solution
hi again. i encountered a concern.

some of the invoices have staggered payments. see sample below:

DateTypeAmount
11/1/2024Payment1500
10/1/2024Invoice #11500
9/1/2024Invoice #21000
8/1/2024Payment3000
7/1/2024Invoice #33500
6/1/2024Payment2000
5/1/2024Invoice #11500
4/1/2024Invoice #33500
3/1/2024Invoice #4500

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. given the formula provided earlier, 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
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,124
Members
453,021
Latest member
Justyna P

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