Question

I'm using Google Docs Spreadsheet and I want to calculate how many years there is left on a debt from a fixed date (YYYY-MM-DD), into a date (same formation).

Example: I started to pay off on a debt which are on 20 000, 2014-03-31. Every month, I'll pay 200 and the debt will be payed off 2022-03-31. If I change the pay sum (200) to another sum, the date will be based on the new sum and change the final debt year.

How can I accomplish this?

Was it helpful?

Solution

If you are satisfied with a more or less exact solution, you can write:

=A1+(30*D1/D2)

where:

  1. A1 is your starting date (in date format), such as: 2014-03-31
  2. D1 is your total amount of debt, in this example: 20000
  3. D2 is your monthly sum of debt payed, in this example: 200

The formula simply counts how many months you need to clear the debt (D1/D2, which gives 100), and then multiples it by the average days of a month (30). Then it adds this amount of days to the starting date. Actually this example gives the result: 2022-06-17 as the final clearance of the debt.

As I said it's not fully exact as it counts 30 days as an average month and it does not count loop years, but I think that it can be used for your purpose.

I hope it helps.

UPDATE:

You'll get a little closer result to the exact value, if you use this:

=A1+(365*quotient(D1/D2,12))+(30*MOD(D1/D2,12))

The QUOTIENT function will calculate how many years are needed (in the example D1/D2 divided by 12). We multiply this value with 365 (the number of days in a year).

Then the MOD function calculates how many more months are needed after the years, which is the modulo of "D1/D2 divided by 12".

This function will give 2022-07-27 as a result for this example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top