Reputation: 532
Payments left is calculated by matching the first occurrence of value zero and returning the index of that row (I am subtracting 2 because first payment is on row 2).
This works now because first payment is on June 1, 2020 but If I open this spreadsheet 3 months from now it will still say payments left 15. That will not be correct anymore since at that time 3 payments are made so should say payment left 12.
Is there any way to dynamically know at what row should the calculation of "Payments left" start.
With other words if today is August 15 2020 (I can manually enter today's date if needed), then calculating Payments left should start from September 1, 2020 until the end.
Upvotes: 0
Views: 638
Reputation: 4561
DATEDIF() function returns the time period between 2 to dates in the units specified. You can keep today's day in one cell with the TODAY() function, and sum in your formula the index of the table plus the months elapsed since the last payment. Pesudocode example would be:
your formula + DATEDIF(LastpaymentCellAddress; TODAY()StoredCellAddress, "m")
The third argument "m" is to return the time elapsed in months.
Take into account that the dates in the arguments must follow an order fo the function to work, and the smaller date goes first. It is time from-to function.
Hope that helps
Upvotes: 1
Reputation: 532
After playing a little bit around I was able to accomplish that with this formula:
where Last Payment Sent is: =DATE(YEAR(TODAY()),MONTH(TODAY()),1)
Upvotes: 1