What is the equation for calculating an investment with compounding interest and periodic contribution?
$begingroup$
I am a begginner C# programmer working on a investment calculator as a personal project. I have not done much math in the last 15 years, please help.
The parameters are:
Principal - the original sum deposited in the account, lets say 1000
Interest - for example 5(%). This can be calculated monhly or yearly
Compound Interval - Years for the investment to grow, like 10 years
intervalsInAYear - how many times in a year the interest is calculated(12 for monthly)
Additional contribution, monthly or yearly, for example 100 per month
The equation below is what i got working, but it does not have the additional contribution:
$$endAmount = principal {left( {1 + {{interest} over intervalsInAYear }} right)^{intervalsInAYear:*:compoundInterval}}$$
linear-algebra economics programming
$endgroup$
|
show 3 more comments
$begingroup$
I am a begginner C# programmer working on a investment calculator as a personal project. I have not done much math in the last 15 years, please help.
The parameters are:
Principal - the original sum deposited in the account, lets say 1000
Interest - for example 5(%). This can be calculated monhly or yearly
Compound Interval - Years for the investment to grow, like 10 years
intervalsInAYear - how many times in a year the interest is calculated(12 for monthly)
Additional contribution, monthly or yearly, for example 100 per month
The equation below is what i got working, but it does not have the additional contribution:
$$endAmount = principal {left( {1 + {{interest} over intervalsInAYear }} right)^{intervalsInAYear:*:compoundInterval}}$$
linear-algebra economics programming
$endgroup$
$begingroup$
Well...I think you are using "Compound Interval" to mean two different things. You need to specify the "compounding frequency". If, say, we are compounding every six months, then you need the denominator in your expression to be $2$. Then you also need to take into account the number of compounding periods. That would be the number of compounding periods under consideration. For instance, if you have semi-annual compounding for $5$ years then you have $10$ compounding periods.
$endgroup$
– lulu
Jan 23 at 12:14
$begingroup$
All this stuff is pretty well documented on line...see, e.g., this.
$endgroup$
– lulu
Jan 23 at 12:17
$begingroup$
Thank you for your answer. intervalsInAYear is now in the parameter list. What i need is the equation used to calculate the endAmount WITH montly contributions. The equation will be featured in the application with MathJax, as a visual aid for the calculator user.
$endgroup$
– Cristi Priciu
Jan 23 at 12:29
$begingroup$
As I say, the frequency must appear in the denominator. If, say, you invest $100$ at a rate of $6%$ for $5$ years compounded semi-annually, then the end result should be $100times left(1+frac {.06}2right)^{10}$.
$endgroup$
– lulu
Jan 23 at 12:33
$begingroup$
Thank you for you message. Your formula and the one in my question do the same thing. What the question asks is what is the formula with periodic contribution.
$endgroup$
– Cristi Priciu
Jan 23 at 12:37
|
show 3 more comments
$begingroup$
I am a begginner C# programmer working on a investment calculator as a personal project. I have not done much math in the last 15 years, please help.
The parameters are:
Principal - the original sum deposited in the account, lets say 1000
Interest - for example 5(%). This can be calculated monhly or yearly
Compound Interval - Years for the investment to grow, like 10 years
intervalsInAYear - how many times in a year the interest is calculated(12 for monthly)
Additional contribution, monthly or yearly, for example 100 per month
The equation below is what i got working, but it does not have the additional contribution:
$$endAmount = principal {left( {1 + {{interest} over intervalsInAYear }} right)^{intervalsInAYear:*:compoundInterval}}$$
linear-algebra economics programming
$endgroup$
I am a begginner C# programmer working on a investment calculator as a personal project. I have not done much math in the last 15 years, please help.
The parameters are:
Principal - the original sum deposited in the account, lets say 1000
Interest - for example 5(%). This can be calculated monhly or yearly
Compound Interval - Years for the investment to grow, like 10 years
intervalsInAYear - how many times in a year the interest is calculated(12 for monthly)
Additional contribution, monthly or yearly, for example 100 per month
The equation below is what i got working, but it does not have the additional contribution:
$$endAmount = principal {left( {1 + {{interest} over intervalsInAYear }} right)^{intervalsInAYear:*:compoundInterval}}$$
linear-algebra economics programming
linear-algebra economics programming
edited Jan 23 at 13:00
Cristi Priciu
asked Jan 23 at 12:10
Cristi PriciuCristi Priciu
11
11
$begingroup$
Well...I think you are using "Compound Interval" to mean two different things. You need to specify the "compounding frequency". If, say, we are compounding every six months, then you need the denominator in your expression to be $2$. Then you also need to take into account the number of compounding periods. That would be the number of compounding periods under consideration. For instance, if you have semi-annual compounding for $5$ years then you have $10$ compounding periods.
$endgroup$
– lulu
Jan 23 at 12:14
$begingroup$
All this stuff is pretty well documented on line...see, e.g., this.
$endgroup$
– lulu
Jan 23 at 12:17
$begingroup$
Thank you for your answer. intervalsInAYear is now in the parameter list. What i need is the equation used to calculate the endAmount WITH montly contributions. The equation will be featured in the application with MathJax, as a visual aid for the calculator user.
$endgroup$
– Cristi Priciu
Jan 23 at 12:29
$begingroup$
As I say, the frequency must appear in the denominator. If, say, you invest $100$ at a rate of $6%$ for $5$ years compounded semi-annually, then the end result should be $100times left(1+frac {.06}2right)^{10}$.
$endgroup$
– lulu
Jan 23 at 12:33
$begingroup$
Thank you for you message. Your formula and the one in my question do the same thing. What the question asks is what is the formula with periodic contribution.
$endgroup$
– Cristi Priciu
Jan 23 at 12:37
|
show 3 more comments
$begingroup$
Well...I think you are using "Compound Interval" to mean two different things. You need to specify the "compounding frequency". If, say, we are compounding every six months, then you need the denominator in your expression to be $2$. Then you also need to take into account the number of compounding periods. That would be the number of compounding periods under consideration. For instance, if you have semi-annual compounding for $5$ years then you have $10$ compounding periods.
$endgroup$
– lulu
Jan 23 at 12:14
$begingroup$
All this stuff is pretty well documented on line...see, e.g., this.
$endgroup$
– lulu
Jan 23 at 12:17
$begingroup$
Thank you for your answer. intervalsInAYear is now in the parameter list. What i need is the equation used to calculate the endAmount WITH montly contributions. The equation will be featured in the application with MathJax, as a visual aid for the calculator user.
$endgroup$
– Cristi Priciu
Jan 23 at 12:29
$begingroup$
As I say, the frequency must appear in the denominator. If, say, you invest $100$ at a rate of $6%$ for $5$ years compounded semi-annually, then the end result should be $100times left(1+frac {.06}2right)^{10}$.
$endgroup$
– lulu
Jan 23 at 12:33
$begingroup$
Thank you for you message. Your formula and the one in my question do the same thing. What the question asks is what is the formula with periodic contribution.
$endgroup$
– Cristi Priciu
Jan 23 at 12:37
$begingroup$
Well...I think you are using "Compound Interval" to mean two different things. You need to specify the "compounding frequency". If, say, we are compounding every six months, then you need the denominator in your expression to be $2$. Then you also need to take into account the number of compounding periods. That would be the number of compounding periods under consideration. For instance, if you have semi-annual compounding for $5$ years then you have $10$ compounding periods.
$endgroup$
– lulu
Jan 23 at 12:14
$begingroup$
Well...I think you are using "Compound Interval" to mean two different things. You need to specify the "compounding frequency". If, say, we are compounding every six months, then you need the denominator in your expression to be $2$. Then you also need to take into account the number of compounding periods. That would be the number of compounding periods under consideration. For instance, if you have semi-annual compounding for $5$ years then you have $10$ compounding periods.
$endgroup$
– lulu
Jan 23 at 12:14
$begingroup$
All this stuff is pretty well documented on line...see, e.g., this.
$endgroup$
– lulu
Jan 23 at 12:17
$begingroup$
All this stuff is pretty well documented on line...see, e.g., this.
$endgroup$
– lulu
Jan 23 at 12:17
$begingroup$
Thank you for your answer. intervalsInAYear is now in the parameter list. What i need is the equation used to calculate the endAmount WITH montly contributions. The equation will be featured in the application with MathJax, as a visual aid for the calculator user.
$endgroup$
– Cristi Priciu
Jan 23 at 12:29
$begingroup$
Thank you for your answer. intervalsInAYear is now in the parameter list. What i need is the equation used to calculate the endAmount WITH montly contributions. The equation will be featured in the application with MathJax, as a visual aid for the calculator user.
$endgroup$
– Cristi Priciu
Jan 23 at 12:29
$begingroup$
As I say, the frequency must appear in the denominator. If, say, you invest $100$ at a rate of $6%$ for $5$ years compounded semi-annually, then the end result should be $100times left(1+frac {.06}2right)^{10}$.
$endgroup$
– lulu
Jan 23 at 12:33
$begingroup$
As I say, the frequency must appear in the denominator. If, say, you invest $100$ at a rate of $6%$ for $5$ years compounded semi-annually, then the end result should be $100times left(1+frac {.06}2right)^{10}$.
$endgroup$
– lulu
Jan 23 at 12:33
$begingroup$
Thank you for you message. Your formula and the one in my question do the same thing. What the question asks is what is the formula with periodic contribution.
$endgroup$
– Cristi Priciu
Jan 23 at 12:37
$begingroup$
Thank you for you message. Your formula and the one in my question do the same thing. What the question asks is what is the formula with periodic contribution.
$endgroup$
– Cristi Priciu
Jan 23 at 12:37
|
show 3 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3084390%2fwhat-is-the-equation-for-calculating-an-investment-with-compounding-interest-and%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3084390%2fwhat-is-the-equation-for-calculating-an-investment-with-compounding-interest-and%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Well...I think you are using "Compound Interval" to mean two different things. You need to specify the "compounding frequency". If, say, we are compounding every six months, then you need the denominator in your expression to be $2$. Then you also need to take into account the number of compounding periods. That would be the number of compounding periods under consideration. For instance, if you have semi-annual compounding for $5$ years then you have $10$ compounding periods.
$endgroup$
– lulu
Jan 23 at 12:14
$begingroup$
All this stuff is pretty well documented on line...see, e.g., this.
$endgroup$
– lulu
Jan 23 at 12:17
$begingroup$
Thank you for your answer. intervalsInAYear is now in the parameter list. What i need is the equation used to calculate the endAmount WITH montly contributions. The equation will be featured in the application with MathJax, as a visual aid for the calculator user.
$endgroup$
– Cristi Priciu
Jan 23 at 12:29
$begingroup$
As I say, the frequency must appear in the denominator. If, say, you invest $100$ at a rate of $6%$ for $5$ years compounded semi-annually, then the end result should be $100times left(1+frac {.06}2right)^{10}$.
$endgroup$
– lulu
Jan 23 at 12:33
$begingroup$
Thank you for you message. Your formula and the one in my question do the same thing. What the question asks is what is the formula with periodic contribution.
$endgroup$
– Cristi Priciu
Jan 23 at 12:37