When broader markets drop on some bit of general news and take down the price of stocks for no apparent reason, some investors jump at the opportunity it creates and buy a discounted stock they've been watching. It can often pay to be a little greedy when others are acting fearful.

But a sharp stock-price decline also happens for real reasons. That's when questions should arise about what long-term challenges are ahead for the business. Admittedly, Wall Street tends to get too focused on the next quarter or two, giving long-term investors an advantage. But it's still not a good strategy to ignore the red flags that cause a stock to quickly fall even as the broader market falls too.

Dollar General (DG -0.41%) stock is down over 50% in 2023 compared to a 10% increase in the S&P 500. Let's look at whether that slump represents a deal -- or a warning sign -- for prospective investors today.

Dollar General missed some targets

Investors were disappointed to learn that the retailer saw surprisingly weak demand from consumers who became more focused on value into mid-2023. That's normally Dollar General's target market. Comparable-store sales were flat last quarter, missing management's short-term targets. Executives blamed declining customer traffic and soft demand for home supplies as big factors driving the sales weakness.

It's a problem that Dollar General appears to be losing a step with its core customer. Dollar Tree (DLTR 0.04%) said in its Q2 conference call that it was winning market share, for example, and its comps were up a healthy 7% year over year. It would be one thing if Dollar General was simply caught up in a wider industry downturn, but here it looks as if peers are capitalizing on its missteps.

This could take a while

The sales challenges are being compounded by Dollar General's profit issues. Gross profit margin fell by a percentage point to 32% of sales in the most recent quarter. Operating profit dove to $692 million from $913 million, a 24% decline year over year. These issues were fueled by price cuts aimed at keeping inventory moving as customer traffic slowed down.

Yet inventory remains elevated. Dollar General reported $7.5 billion of holdings as of early August, up from $6.9 billion. Management is determined to get inventory back in line with demand, but it still might take several quarters, as well as additional profitability reductions, to achieve that result.

Better to watch Dollar General's stock

These problems should convince most investors to just watch this stock from the sidelines. Sure, the valuation has slumped in recent months. You can own Dollar General for about 0.7 times sales, down from 1.6 times sales in early 2023. Shares are priced at just 12 times earnings, too, compared to a P/E ratio of 25 back then.

Dollar General's rebound path isn't clear, though, and its mounting financial challenges could pressure shareholders' returns well into 2024. Investors don't need to wait to see soaring profits before buying this stock.

But they are right to worry about market share losses in today's selling environment. Once management gets customer traffic rates back on track with the wider industry, it might be worth considering this discounted stock. For now, though, investors should look toward more successful retailing businesses.