When you're worried about stock market volatility, the oft-preached advice is to ignore the market's ups and downs and practice dollar-cost averaging rather than lump-sum investing. 

With dollar-cost averaging, you commit to automatically investing a certain amount at regular intervals, such as every week, month or quarter. With lump-sum investing, you'd invest the entire amount at once.

Dollar-cost averaging often reduces your average cost of investing. Yes, sometimes you'll buy at the market's peak, but you'll also invest when stocks are on sale after a market crash

It also removes some of the emotion from investing. Sure, when the market is hot, we all say we'll invest more when stocks plunge. But the reality is, we often don't follow through because we're bad at estimating our actual risk tolerance. Sometimes, we miss out because we're too spooked to seize an opportunity.

As a long-term investment strategy, dollar-cost averaging beats lump-sum investing. But there are a few exceptions. Here are three times lump-sum investing is actually the better strategy.

A man holds his hand to his face. The words "now" and "later" are written beside him.

Image source: Getty Images.

1. The market tanked and you're OK with it tanking more

Lump-sum investing makes sense when the market has just taken a deep dive if you can stomach the possibility that the downward spiral could continue for a while.

Let's pick one of the many abysmal days the stock market had mid-March -- say, Monday, March 9. By then, it was clear the market was in a free fall. The S&P 500 plummeted more than 200 points, closing at 2,746.56 that day.

Suppose you'd invested $1,000 across the S&P 500 on March 9 -- not knowing how much worse things could get, but also looking at the historical likelihood of recovery. 

The worst was still yet to come. By March 23, the day the index bottomed out, your $1,000 investment would have been worth $814.60. 

But today, your $1,000 investment would be worth about $1,200. 

Sure, you would have made even more money had you perfectly timed the market by investing in a lump sum on March 23, when stocks reached their low point. But perfect timing is nearly impossible to achieve. Had you invested on March 9 or any other similarly bad day during the coronavirus crash, your returns would still be significantly higher than if you had dollar-cost averaged $200 a month for five months straight.

If you're not comfortable with some volatility, dollar-cost averaging is probably the better strategy. But lump-sum investing pays off when stocks are down and you see opportunity, so long as you're OK with them dropping further in the short term.

2. You're sitting on lots of cash

Today's low interest rates are great for borrowers but terrible for savers. So if you have plenty of cash beyond what you need in an emergency fund, it's best to go ahead and start investing in a lump sum, rather than letting it linger in a savings account earning less than 1%.

A commonly repeated investing adage: "Time in the market beats timing the market." Basically, it means you'll benefit more from giving your money plenty of time to compound than you will by trying to invest at the perfect time.

If you'd invested in a security that tracked the S&P 500 at any time in the last 100 years and didn't touch your money for two decades, your 20-year average returns would have been positive no matter when you invested. Even if you bought when stocks were high and sold more than 20 years later during a downturn, you still wouldn't have lost money.

Just note that if you're investing a large lump sum, it's best to do so with an index fund that tracks a major stock index, rather than picking your own stocks. When you invest in individual companies, there is a high risk of losing money.

3. You got a one-time windfall

If you've just received a large bit of cash from an inheritance, tax refund, or bonus, investing in a lump sum is a good way to put it to work. Provided that you already have a diversified portfolio and healthy retirement savings, this can be a good opportunity to invest in individual stocks you've had your eye on. 

Why dollar-cost averaging still (mostly) wins

Lump-sum investing shouldn't be a replacement for dollar-cost averaging, but chances are that you're already practicing dollar-cost averaging. If you contribute to your 401(k) plan or automatically invest in an IRA each month, you're a dollar-cost averager.

So long as you're consistently practicing dollar-cost averaging, lump-sum investing is a good strategy when you see opportunity.