Excellent point Carter. I sometimes find myself committing the same error. But, I’ll add a caveat: if you’re trying to purchase something in the short term--1 to 2 years, say--then I would argue that it’s better to save for it, rather than invest.
Assuming an average rate of return for the stock market only makes sense when we are considering long time periods--so that your yearly returns get closer to the average returns. During short time periods, there is not enough time for the Law of Large Numbers to kick in, and so, your investment returns will be exceedingly more volatile than in long time periods.
Examples of saving for something in the near future might be vacations or maybe a really nice computer.