With its stock up 5% year to date, Dollar General (DG -0.31%) has ducked the worst effects of the bear market that has sent the S&P 500 down 21% in 2022. The company's focus on low-priced staples give it an edge in this challenging macroeconomic environment. And recent legal challenges look unlikely to derail its trajectory. Let's dive in.

Focused on the long term

Founded in 1939, Dollar General is a relatively mature company, so investors shouldn't expect sustained breakneck growth. But second-quarter earnings show that business is holding up well in this challenging macroeconomic environment. Net sales jumped 9% to $9.4 billion, driven by the revenue from new stores. The company opened 227 locations in the period, bringing its total to 18,566 as of July.

With 60% of economists surveyed in a Bloomberg poll expecting the U.S. economy to enter a recession in the next 12 months, the near term will be challenging for many retail companies. But according to Dollar General CEO Todd Vasos, "We do very good in good times and we do fabulous in bad times." The company's discount business model and focus on everyday needs in rural areas and underserved communities should help shield it from a downturn. 

Recent headlines

Dollar General has been in the news after Ohio's Attorney General sued the retailer over alleged pricing errors at some of its locations. This comes after an earlier report from Ohio's Butler County auditor found such mistakes as a Coffee Mate creamer with a shelf price of $2.00 that scanned for $4.35, among other errors. The lawsuit seeks to stop Dollar General from making future violations, unspecified damages for shoppers, and civil fines of $25,000 per violation.

It is impossible at this point to know how the matter will be resolved. But for context, the company settled a similar suit in Vermont for $1.75 million in 2019 -- a fraction of the $27.8 billion in revenue it earned that year. The shares are down roughly 1% from the date of the announcement on Nov. 1, suggesting this situation will not have much impact on Dollar General's long-term operations. 

Green arrow moving upwards in front of hundred-dollar bill.

Image source: Getty Images.

Returning value to investors  

Dollar General's management is optimistic about the future, expecting net sales growth of 11% and earnings-per-share growth of 12% to 14% (this would be $11.49 per share at the mid-range). The company boasts a dividend yield of 0.89%, which isn't a particularly impressive number.

But it bolsters the cash payout with a share buyback program that is expected to retire $2.75 billion worth of stock for the year. Buybacks can benefit investors by reducing the total number of shares outstanding -- increasing the fundamental value of each share relative to the company's earnings and cash flow. 

With a forward price-to-earnings (P/E) multiple of 19.6, Dollar General looks reasonably valued compared to the S&P 500's average of 18.4, especially when you consider it has the ability to weather current macroeconomic challenges better than the typical company. The stock could make a good addition to a diversified investment portfolio.