The beginning of 2023 was filled with warning signs of a potential recession and a continued market slump after the S&P 500 (^GSPC 1.02%) finished 2022 down over 19%. But in the past 13 months, the index has actually gained 30%.

This surge has been cheered by investors who were along for the ride. However, some people may now have reservations about investing in the index near its all-time high, fearing a potential market correction. Those concerns are valid, but here's why letting them influence your investing decisions can hurt you in the long run.

It's about time in the market, not timing the market

One of the hardest parts of stock investing, for investors of all types, is not trying to time the stock market. The goal in investing is to buy low and sell high, so it makes sense people would want to load up on stocks when they're perceived as cheap and avoid them when they're perceived as expensive.

The problem is the stock market isn't always rational, and it's hard to reliably predict how it will move in the short term. Just because a stock is overvalued doesn't mean it's guaranteed to go lower; its "high" price could very well be its new floor. The goal should be to focus on spending as much time in the market as possible because spending days on the sideline could really affect your returns.

To understand the importance of time in the market, let's assume someone invested $10,000 in the S&P 500 on Dec. 31, 2007, and left it there until Dec. 31, 2022. Below is how the investment would have performed based on how many of the S&P 500's best days (defined by single-day price movements) were missed.

Number of Best Days Missed Annualized Total Return Value of $10,000 Investment
0 10.66% $45,682
10 5.05% $20,929
20 1.59% $12,671
30 (1.18%) $8,365
40 (3.58%) $5,786

Data source: Putnam Investments

There were 3,780 trading days in those 15 years. Missing just 10 of the best days (0.26% of the total) caused the investment's final value to fall by more than half. And missing 30 (0.79% of the total) would've resulted in a loss over that period.

You can be skeptical and invest simultaneously

You don't want to be on the sideline waiting for a better time to enter the market because that day may never come.

That said, if you're skeptical of investing right now because the S&P 500 is near all-time highs, try taking the dollar-cost averaging approach. When you dollar-cost average, you decide on an amount you can afford to invest and then put yourself on a set investing schedule. It's what I do with the Vanguard S&P 500 ETF (VOO 1.00%).

I have a set amount I commit to the Vanguard S&P 500 ETF each month and make bi-weekly investments, regardless of its price at the time. The latter part is the most important feature of dollar-cost averaging. The goal is to invest no matter what stock prices are because dollar-cost averaging is intended to offset the impact of volatility.

VOO Chart

Data by YCharts. Figures show the value of a $10,000 investment from Feb. 7, 2014, to Feb. 7, 2024.

The Vanguard S&P 500 ETF has had no shortage of volatility, but it doesn't matter too much if the results are there in the long term. Dollar-cost averaging is good at helping investors avoid trying to time the market and trust their portfolio's long-term growth potential.

Your investing schedule is set in advance, so there's no need to wait for the "perfect" moment. You'll buy at both high and low points -- what's most important is your entry points balance each other out over time, while you benefit from the market's long-term upward trend.