I'm doing a simple budget app, to make some calculations to improve private economy.
I've made an option where you can enter the value of the money that are in the bank right now, and how many days there are left in the month. Now it calculates the daily average. Fx if I enter 6400 at my account, and 18 days left, i will get that i can spend 355,55 pr day for the rest of the month. Simple division. So far so good.
But now i want to make an algorithm that can calculate, how much I can spend in x days, to improve the daily average for the rest of the month.
So I can enter some values:
M: How much there are on my account today (fx. 6400)
D: How many days there are left in the month (fx. 18) (here I will get the average of 355,55)
V: How much I will spend pr. day in x days, to improve the average (fx. 300).
A: How much I want to improve my average to, for the rest of the month (fx. 400).
If I have an average at 355,55 pr day for the rest of the 18 days in the month, how can I calculate how many days I would have to spend only 300 pr day, to get my average up to 400 pr day, for the remaining days of the month?
What kind of formula would I be using?
Thanks so much.