Discount retailers like Dollar General (DG 1.34%) are good stocks to buy in good times because they can help low- and middle-income consumers stretch their budgets further. But during periods of high inflation and elevated gas prices, they become downright essential.

Dollar General's fiscal second-quarter earnings report, released early Thursday morning, shows just how popular its stores are proving with consumers -- its revenue, same-store sales, customer traffic, and profits all rose.

Having made investments in its business years ago that allowed it to offer more consumables, the discount chain today is reaping the benefits as those categories contribute to its market share gains.

Father and daughter shopping in grocery aisle.

Image source: Dollar General.

Groceries have become a key category

For the 13-week period that ended July 29, Dollar General's sales increased 9% year over year to $9.4 billion. That was also 35% above what it generated in fiscal Q2 2019, indicating how well-aligned the retailer is becoming with consumer needs in difficult times. Same-store sales were up 4.6% in the quarter as stronger customer traffic helped accelerate its market share growth in the highly consumable products segment. 

The discount chain's management is even more bullish about its prospects. Having already raised its full-year outlook when it reported on its fiscal first quarter, Dollar General increased it yet again last week. It now forecasts revenue growth of 11% for the year (versus its previous guidance of a 10% to 10.5% gain) with comps expected to rise by 4% to 4.5% (compared to the prior forecasts of 3% to 3.5%). Customers are spending more on consumables like food, but less on apparel, seasonal goods, and home products.

Both Walmart and Target have reported similar patterns regarding what consumers are spending their money on, yet CEO Todd Vasos said in the Q2 earnings press release that Dollar General is still well-positioned to capitalize on the pivot.

"Looking ahead, we are confident that our strategic actions, which have transformed this company in recent years and solidified Dollar General as the clear leader in small-box discount retail, have positioned us well for continued success, while supporting long-term shareholder value creation."

Adjusting its expansion plans

Surprisingly, the market was not thoroughly impressed with Dollar General's report. The stock closed Thursday's trading session slightly lower, perhaps due to traders' wariness about the possibility that higher costs and supply chain problems will weigh on the discount retailer too.

Consumables are also a lower-margin category than others the chain carries, and a greater share of sales coming from them could put pressure on its profits, although Dollar General did see across-the-board increases in gross, operating, and net margins.

Supply chain issues, though, are impeding new store openings. Where the discount retailer had expected to undertake 2,980 real estate projects -- 1,110 new store openings, 1,750 remodels, and 120 relocations -- it's now adjusting its focus away from adding news stores and toward working more with existing ones. It now anticipates there will be between 2,930 and 2,980 projects total consisting of between 1,010 and 1,060 new store openings, 1,795 remodels, and 125 relocations.

A critical success

Dollar General will continue to reward its investors, however, by buying back shares and paying dividends. In its fiscal second quarter, it repurchased $349 million worth of its common stock, or 1.5 million shares, and declared a quarterly cash dividend of $0.55 per share, which currently yields just under 1% annually. The board of directors also raised its buyback authorization by $2 billion.

Dollar General has firmly established its place in the retail landscape, and as more consumers look to deep discount retailers to help them make ends meet amid high inflation, its market share looks likely to grow. Further, there's no indication the macroeconomic situation will improve anytime soon. That suggests this stock ought to do well for investors in the next few years.