Created
January 18, 2010 07:18
-
-
Save taka2/279853 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Option Explicit | |
| ' 8万円を、30年間、1年複利で、7%で運用 | |
| msgbox CalcReinvestment(80000, 12, 30, 0.07) | |
| ' 8万円を、30年間、半年複利で、7%で運用 | |
| msgbox CalcReinvestment(80000, 6, 30, 0.07) | |
| ' 8万円を、30年間、1ヶ月複利で、7%で運用 | |
| msgbox CalcReinvestment(80000, 1, 30, 0.07) | |
| ' 毎月の積み立て額、再投資頻度、積立期間、予定利率を入力すると、 | |
| ' トータルリターンを計算する | |
| Function CalcReinvestment(amount, freq, term, ratio) | |
| Dim total, i | |
| total = 0 | |
| For i = 1 to (term * 12 / freq) | |
| total = total + amount * freq | |
| total = Round(total * (1 + (ratio / 12 * freq)), 0) | |
| Next | |
| CalcReinvestment = total | |
| End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment