I have a calculator that allows users to see how much they need to save per period (month, year, etc) when putting money into a savings account. There are N withdrawals made in the end, with N ranging from 1 to 9, and years ranging from 1 to 22 (making periods range from 1 to 12*22=264). Each withdrawal is made in one period. For example:
Year : 1 2 3 4 5 6 7
Withdrawal: 0 0 0 0 7 7 9
Users input how much what they're saving for costs now, how much the interest rate on that cost is, the rate their investment will grow, and for how many years they'll be saving. The calculator outputs how much they should save per period.
I am trying to allow for a lump-sum investment though. Setting the period to 1 in the calculator does not output a correct answer. Is there a formula that anyone knows off-hand for this?
To be clear: with the inputs described above, I am looking for the output of what the initial investment amount should
-------------EDIT------------
Example input:
years: 4
# of withdrawals: 2
goal (sum of withdrawals): $22,601
interest rate: 0.06 (6%)
I need it to output the following:
lump sum deposit: $19,454