The formula
A = P × (1 + r ÷ n)n × t
P is the starting amount, r the yearly rate as a decimal, n how many times a year interest is added and t the number of years. Monthly deposits are added at the end of each month and earn interest from then on.
Worked example
10,000 at 5% a year, compounded monthly for 10 years with no deposits, grows to 16,470.09. Adding 100 at the end of every month takes it to 31,998.32: you pay in 22,000.00 and earn 9,998.32 in interest.
What it leaves out
The result assumes a fixed rate for the whole term and ignores tax, fees and inflation. Investment returns are not guaranteed and can be negative. This is general information, not financial advice.