Dollar General (DG -0.41%) is a discount retailer that provides consumers with an array of different products, including clothing, household items, food, and much more. It's the type of company that investors might expect to do well as consumers look to trim their budgets amid inflation.

But while the business is still growing, it's not as fast as the company expected. And profits have also nosedived. The result is a struggling stock whose valuation is around one-half of what it was this time last year. Has this become a bad stock to own, or can Dollar General still make for a good investment?

Reducing its guidance again

Dollar General reported its second-quarter earnings last month, and the results weren't great. Although net sales of $9.8 billion for the period ended Aug. 4 rose by 3.9% year over year, the company's same-store sales were down 0.1%. The most alarming figure was the company's 24.2% decline in operating profit, which fell to $692.3 million. Dollar General has been struggling with moving inventory and says it is working on accelerating that process. 

But clearly, there are challenges for the business as the retailer projects net sales growth for the current fiscal year (which ends in January) to be between 1.3% and 3.3%. In June, it forecast full-year growth between 3.5% and 5%. Prior to that, the company was expecting a growth rate of 5.5% to 6%.

The retail chain looks to have underestimated how difficult it would be to move excess inventory. And if it becomes more aggressive, that can result in worse gross margins and earnings.

Growth hasn't always been easy

Last year, Dollar General experienced strong growth, and that may have resulted in the company overestimating its opportunities for this year. But when looking at the 10-year trend, the growth rate has normally been modest at less than 9%. While there have been spikes due to the pandemic, this hasn't been a fast-growing business.

But the important takeaway from the chart below is how resilient Dollar General is, always finding ways to achieve positive year-over-year revenue growth.

DG Revenue (Quarterly YoY Growth) Chart

DG Revenue (Quarterly YOY Growth) data by YCharts.

And while there have been fluctuations in profitability, that has for the most part been moving in the right direction.

DG Net Income (Quarterly) Chart

DG Net Income (Quarterly) data by YCharts.

Does the stock provide good value?

Shares of Dollar General are down big this year as investors have punished the company for cutting guidance multiple times. And sharp declines in profitability don't do the business any favors, either. But from looking at the stock's value, there is a contrarian argument to be made here as it is trading at a considerable discount.

DG PE Ratio Chart

DG P/E Ratio data by YCharts.

Investors haven't been able to buy Dollar General for this low of a valuation in the past decade. Although the stock isn't at a 10-year low, when looking at its price-to-earnings (P/E) ratio, it looks like a bargain buy. The S&P 500 averages a P/E of 20, which makes Dollar General look dirt cheap by comparison. 

Should you buy Dollar General stock?

Dollar General is facing challenges today, but they aren't insurmountable ones. The business is still growing, with Dollar General opening 215 stores last quarter and remodeling 614 others. The stock is near its 52-week low, and it's a good value buy for investors who are willing to be patient and buy and hold. Dollar General is likely to recover, and when it does, it may produce some fantastic returns for investors.