Skip to content

Instantly share code, notes, and snippets.

@dustinfarris
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinfarris/376c3f6d1f59803c9a8f to your computer and use it in GitHub Desktop.
Save dustinfarris/376c3f6d1f59803c9a8f to your computer and use it in GitHub Desktop.
A very elementary way of projecting the impact of investment fund fees
def calc(principal, fee_pct, avg_growth_pct, annual_contrib, years):
"""
>>> calc(10000, 1.5, 7, 5500, 35)
(154256.73, 48243.27)
>>> calc(10000, 1.0, 7, 5500, 35)
(168507.21, 33992.79)
>>> calc(10000, 0.5, 7, 5500, 35)
(184508.4, 17991.6)
"""
fee = fee_pct / 100
avg_growth = avg_growth_pct / 100 + 1
total_fees_paid = 0
for x in range(years):
principal *= avg_growth
principal += annual_contrib
cost = principal * fee
principal -= cost
total_fees_paid += cost
return round(principal, 2), round(total_fees_paid, 2)
@dustinfarris
Copy link
Author

I was comparing Fidelity and Vanguard index funds, and discovered what an impact a small difference in fees can make. In this (rudimentary) example above, the difference of just 1% in annual fees over 35 years can make a $30,000 difference in your portfolio!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment