[Example] [1] [1]: link
1 - investment by the client;
2 - start of the contract;
3 - duration of the contract,
4 - rate of return for each customer;
5 - if the client chose to withdraw the monthly income or not;
6 - amount to be deposited monthly for those who opted for monthly deposit;
7 - Date of termination of the contract;
8 - final value to be withdrawn at the end of the contract;
9 - administrative fee charged for each withdrawal;
10 - how many days have elapsed from the date of the contract; (= ($ A $ 1-C3))
11 - conversion of item 10 to months; (it was the only way I found to have the result of item 12) (= K3 / (365/12))
12 - give me how much you have already earned since the beginning of your contract; (= B3 * (((1 + E3) ^ L3) -1))
13 - the problem is here; the clients that opt for monthly withdrawals will have the same value every month, exp R $ 10000,00 to 8% = R $ 800.00 every month, but I must dilute this amount for each day of the month, and return the income of the first day until the present day, and when it turns the month it all starts again.