This article links to a S&P 500 Periodic Reinvestment Calculator which allows you to run through investment scenarios as if you had been invested in the past. It includes dividends paid, dividend taxes, capital gains taxes, management fees, and inflation.
It allows you to modify all tax and fee fields to model custom scenarios, such as investing in tax free accounts or in funds with various management fees. After a scenario is run, you can graph the result over time or export your results to a csv to import into your favorite spreadsheet program.
It uses data published by Robert Shiller, which you can find at his site here. Our S&P 500 methodology from our S&P 500 Reinvestment Calculator and Dow Jones Industrial Average Reinvestment Calculator is repeated; please read those articles if you are interested in the return calculations. Read on for the rest of our methodology!
The S&P 500 Periodic Investment Calculator
When you open the S&P 500 Reinvestment Calculator (click the link or the image), you will be presented with a screen like this:
Basic Options for the S&P 500 Periodic Reinvestment Calculator
- Starting Month & Year – When to start the scenario. This field will default to 10 years before the most recently updated month.
- Ending Month & Year – When to end the scenario. This field will default to the most recently updated month. Please see the S&P 500 Reinvestment Calculator for details on what that means – usually the most recent month is based on the closing price of a single day.
- Starting Amount ($) – A lump sum value which is invested only once in the Starting Month & Year
- Monthly Investment ($) – The value of a periodic, monthly investment. It is not applied in the first month, but will apply every month thereafter. Note that how you set the next field will change the behavior of this amount drastically.
- How to Change Monthly Investment?
- Keep it Constant – Every month will use the same investment amount.
- Increase it by Inflation – Robert Shiller added historical inflation values chained to CPI to his S&P 500 data (see his site for details). This field will increase the monthly investment by inflation. Clicking this will let you choose if the investment amount is the terminal or the starting amount. (Credit for that idea goes to our friend Jeremy at Go Curry Cracker.)
- Increase it by (x)% Monthly – This field will increase the monthly value by a constant amount. (The default is .0829% a month, or 1% annually)
- Custom (Advanced Section) – Please see the Advanced Section below for details.
- Calculate – Calculate the investment performance with whatever options are currently selected. (Run this first).
- Reset – Reset all the fields to the calculator defaults.
- Download CSV – After ‘Calculate’ is run, this exports all of the monthly data to a spreadsheet in csv format. It includes some internal values which show the amount lost to taxes and fees monthly, and includes a running total of the portfolio value.
- Show Graph – After ‘Calculate’ is run, this plots a simple graph of the running total portfolio value by month.
- Final Value of Portfolio ($) – The final portfolio value before any sales are made.
- Annualized Return (XIRR – $) – The internal rate of return for the cash flows implied by the inputs. If monthly investments are set to ‘0’, this will be based on the original purchase.
- Total Invested (Cost Basis – $) – The amount invested, in total, as an input to XIRR and (optional) as an input to the capital gains calculation. This includes lump sums, monthly investments, and dividends reinvested (net of taxes).
- Value After Capital Gains Tax ($) (OPTIONAL) – If the Capital Gains tax in Advanced Options is greater than 0%, this field will estimate the value of the portfolio after selling it all as a lump sum.
Advanced Options for the S&P 500 Periodic Reinvestment Calculator
Clicking on the button labeled ‘Click to Show Advance’ will open up the advanced options of the tool.
- Taxes – options for dividend tax treatment
- Ignore Taxes – disregards taxation on monthly dividend payments
- Count Estimated Taxes – changes taxes on monthly dividend payments based on the tax rates in the ‘Custom Dividend Tax Entry‘ box as explained below.
- Management Fees – options for management fees
- Ignore Fees – disregards management fees
- Count Estimated Taxes – charges a monthly management fee as specified in the ‘Custom Management Fee Entry‘ box as explained below.
- Capital Gains Tax Rate (%) – a percentage tax to apply to estimate the value of the portfolio if it is sold in a lump sum at the scenario’s conclusion.
Tool Default Overrides
These fields are pre-populated by the tool and we have no way to save your inputs on the server. Please make sure you back them up if you are running a complex scenario!
It is designed for you to set up your own defaults as two columns in your favorite spreadsheet program, then just select both columns and paste directly into the tool’s text box:
- The date must be in the format: MM-DD-YYYY.
- The date must be followed by a tab or whitespace character.
- The whitespace must be followed by a value which applies to that date forward, inclusive of the date.
- Custom Dividend Tax Entry
- Only the ‘year’ matters for this field; tax values are applied for the entire year.
- Defaults are based on the estimated federal dividend tax of a United States dwelling median earner using tables from the Tax Foundation (thank you!) crossed with changes in dividend tax laws as explained to me by Wikipedia in February 2015.
- Custom Management Fee Entry
- Defaults are courtesy this Vanguard statement, extrapolated forward from 1975 and backwards with 1.5% arbitrarily chosen as the starting annual management cost in 1871.
- Monthly Investment Entry
- If (and only if) you choose ‘Custom (Advanced Section)‘ in the ‘How to Change Monthly Investment?‘ field of the basic options, this table’s month and year will be used to set the periodic investments.
- If active, only the months listed will be used in the calculations, so it can be used to model annual or quarterly investments, as well as (or in addition to) one time lump sum investments.
Methodology for the S&P 500 Periodic Reinvestment Calculator
All investment calculations are covered in the S&P 500 Reinvestment Calculator and the Dow Jones Industrial Average Reinvestment Calculator.
As for this tool, the added features are periodic investments, dividend taxes, capital gains taxes, graphing, and exporting your results in monthly resolution. Here is our order of operations for every month other than the first month. (In the first month, we just buy shares at the market price using the lump sum, receive no dividends, and pay no fees or taxes)
- Calculate dividends paid based on running total of shares
- IF there are dividend taxes for that year and IF the user hasn’t checked ‘Ignore Taxes‘
- Pay taxes on the dividends earned
- Calculate amount left over (do not buy more shares yet)
- IF there are management fees for the month and IF the user hasn’t checked ‘Ignore Fees‘
- Pay fees on the running total of shares
- Decrease the running total of shares
- Buy more shares with the dividend amount from step 2/2 at the current market price
- Add this amount to the running total ‘dividend basis’
- Add number of shares to running total
- IF the user wants us to invest monthly
- Buy shares at the current market price, add number of shares to running total
- Add this amount to the running total ‘cost basis’
When we hit the closing month:
- Calculate the final portfolio value:
- Running number of shares * market value on closing month
- Calculate XIRR based on investment amounts and timing. Does not factor in capital gains, if any.
- (Optional) If capital gains are set, calculate theoretical value of portfolio if sold as a lump sum
- Calculate cost basis
- Lump sum + running total of cost basis from monthly investments + running total of dividend investments
- Calculate capital gains tax on capital gains
- (Final value – Cost Basis) * (100% – Capital Gains Rate)
- Output value of portfolio
- Final value – capital gains tax
- Calculate cost basis
Now that you’ve seen our methodology, a disclaimer:
Everything about this tool should be treated as informational and all outputs and calculations should be used for research purposes only. McGraw Hill Financial owns the S&P 500 Index and decides its constituent members, you should defer to them for all exact numbers, timings, and dates.
Double check all numbers output from the tool with your own calculations using source data from elsewhere. We’ve made every effort to present accurate information, but this calculator is maintained by a single hobbyist and there are likely errors and omissions in the data. Even when the data is accurate, choosing different timings and orderings for all of the steps listed above can meaningfully change the final results of the calculations. Proceed at your own risk.
Your Questions and Ideas on How to Use the Tool
We reserve the right to add more questions to this section.
- This is excellent now, but… how often will this update?
- You can check the last updated month by seeing what was set when you opened the page. It should automatically go to the latest data.
- Unfortunately, I have to update manually (for now) so expect about once a month updates. I have a number of calculators pointing to the same file, so when I update one they all pick up the new data automatically; I don’t have to touch each one individually:
- If you come back and the default dates have changed, you’ll know it has recently been updated.
- Why is the data in monthly format? Can you add daily data?
- Robert Shiller is the source of this data, and his methodology can be found on his site. This data is reasonably accurate and I trust it, but it isn’t exact and official. McGraw Hill Financial owns the S&P 500 Index; if you want more specific data on dividend timing or daily data you should seek it out from them.
- How does this data start from before the S&P 500 Index Began (or, when it was composed of 500 companies)?
- See Shiller’s site, but dates before the index are spliced to indexes which reasonably measure similar stocks. If you really don’t like it, you can limit your analysis to more recent years.
- I don’t like your management fee estimates/tax estimates because (I don’t live in America/My state charges Taxes/I earn more/I earn less/My funds are cheaper/My funds are more expensive/etc). Can you change them?
- No, but you can. It is very easy to fill the custom advanced option fields when you use a spreadsheet program to set it up. Here’s what I use (OpenOffice) – it’s free. I used it to test this calculator (on a Mac), so I can vouch for it. Just paste into the fields in the advanced options.
- I hate that you only have monthly investment options! My preferred investment style is (annually/quarterly/biannually/only on leap years/once per child I have), can you add it to the tool?
- No, but you can. Try (OpenOffice) – it’s free. See the above answer, and note that when you do custom investment amounts the tool will only fill in investment amounts of the months you enter, so you can do as many or as few as you want!
- Are the default management fees accurate?
- There are so many index funds with so many different management fees that it’s impossible to have a good number. These are a reasonable start, but even today there is a huge disparity in what different funds cost to manage an index fund. Just change them if you don’t like them, or start from a later date when they better match your expectations.
- How do you have management fees before 1971 when the first index funds were forming?
- No idea – I assume that would be the tracking error and management fee cost of large funds mimicking indexes or something. I made them up. I’m sure a large investor could pay a manager to track an index as well (or buy every stock in an index), but I agree it’s not perfect – most of what we know about indexing is only a generation and a half old.
- How precise is this tool?
- All internal data is rounded off to 4 decimal places. (If you can’t match a calculation exactly, that’s the most likely culprit). As the results are approximate anyway, this isn’t a huge limitation, but please keep it in mind while citing and using the calculator.
- Can you add <some feature I think is important> to the tool? Can you add other asset classes or indexes?
- I’m available for hire if you need something custom, with this data or most any other data I have access to. The tool is in a state which makes me happy. Feel free to leave suggestions, but this is probably the final number of features that will ever be in this calculator. Here’s some other work I’ve done… maybe I’ve already created what you need?
- But I’m…
- That doesn’t sound like the start of a question.
- Can you fix the bug with <something I think is broken>?
- Yes, absolutely… and please bring it up immediately so I can fix the tool! However, if you’re trying to sneak in an enhancement request, the answer is ‘no’ (or ‘hire me’).
- Consider it a reverse birthday gift – the site turns 6 years old, you get a gift! Also, I wanted to run a lot of these scenarios myself, and you’ve already seen the beginnings of this calculator take shape in an article or two. Why not?
- How long did this take?
- The code probably took 10 or 15 hours (I don’t have an exact number – it’s about 1300 lines of code all in), but all the miscellaneous stuff like writing this article and finding source data and defaults probably added another 3-5. With that in mind, please share this piece with all of your friends! Only with a ton of page views will I ever earn anything for my time, haha.
- What was this calculator written in (and on)?
- What else have you written?
- I try to keep the Financial Calculators and Visualizations page up to date.
Conclusion for the S&P 500 Periodic Reinvestment Calculator
So, there you have it – I’ve addressed many of the limitations in the S&P 500 reinvestment calculator and made it so you can run wild with all of your backtesting questions on the S&P 500. I hope that this accomplishes everything I set out to accomplish with the original tool, and additionally silences the few rumblings I still see about passive investing when people argue that investment timing makes a difference which renders arguments using the first calculator moot. If you still think passive investing was a bad long term strategy, please share the assumptions that go into your argument. The CSV file export was made for that sort of analysis!
Also, as we showed in the original calculator, dividends matter. Over longer scenarios, you’ll note that the dividends paid start to dominate the initial investment – that’s the true power of dividends, and as we set out to prove with the original calculator, it’s ridiculous for the financial media to ignore dividends. If you ever see an article posted which ignores the effects of dividends or only quotes price returns on an index, please send the author this way!
Anyway, hope you enjoy the calculator and come back often!