DoArNa
DoArNa

Reputation: 532

Dynamic update based on today's date

I have the following table
enter image description here

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

Answers (3)

rustyBucketBay
rustyBucketBay

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.

https://support.office.com/en-us/article/calculate-the-difference-between-two-dates-8235e7c9-b430-44ca-9425-46100a162f38

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

Abdul Hussain
Abdul Hussain

Reputation: 222

This should do the trick:

=COUNTIFS($A:$A,">"&TODAY())

Upvotes: 0

DoArNa
DoArNa

Reputation: 532

After playing a little bit around I was able to accomplish that with this formula: enter image description here

where Last Payment Sent is: =DATE(YEAR(TODAY()),MONTH(TODAY()),1)

Upvotes: 1

Related Questions