Oftentimes, finding undervalued needles in the proverbial haystack means seeking out businesses with acknowledged problems but reasonable prospects of a steadier, less troublesome future. If Walgreens Boots Alliance (WBA -1.33%) fits this description, the company's shares could revisit their early-2022 peak.

Granted, it takes guts to invest in a stock that shed 27% of its value in 2022's first half. Walgreens has certainly faced its share of problems lately, but the company is faring reasonably well, given the circumstances. In time, Wall Street might favor Walgreens again -- but by then, the stock price should already have recovered.

Beating forecasts, maintaining guidance

Along with the usual worries over high inflation and supply chain issues, Walgreens has had company-specific headwinds to deal with this year. Among them is a $683 million charge resulting from Walgreens' opioid settlement in Florida, as well as 2022's sharp demand reduction for COVID-19 test kits and vaccinations. As the omicron crises came and went, Walgreens went from administering 11.8 million vaccinations in fiscal 2022's second quarter to just 4.7 million in Q3.

Overall, the company is either thriving or sagging, depending on how you frame the results. Walgreens' third-quarter 2022 sales from continuing operations declined 4.2% to $32.6 billion, but these results beat Wall Street's consensus estimate of $32.06 billion. Turning to the bottom line, Walgreens' adjusted earnings per share (EPS) from continuing operations of $0.96 represented a 30% falloff compared to the prior-year quarter; yet, it also outdid the analysts' consensus estimate of $0.92.

Plus, despite the aforementioned challenges, Walgreens continues to project low-single-digit, full-year 2022 adjusted EPS growth. -- nothing to write home about, perhaps, but at least it's not a guidance cut. The company's confidence is certainly encouraging, and with a trailing 12-month price-to-earnings (P/E) ratio of just 6.54, Walgreens should perk up the ears of any value-conscious investor. At the same time, the company's 4.95% forward annual dividend yield ought to keep income seekers in the fold for a while.

Keeping their Boots on

After conducting a strategic review, Walgreens will evidently keep the "Boots Alliance" part of its full name since the company finally decided to retain its Boots and No7 Beauty Company businesses. This was a long-awaited decision, as Walgreens began the review process in January.

The purported reason for deciding to keep Boots was that "no third party" made Walgreens an offer they couldn't refuse. Even so, it's probably for the best to retain the U.K.'s leading health and beauty retailer (according to the company, at least) as Boots delivered impressive 24% comparable sales growth in fiscal 2022's third quarter, with market-share improvement "across all major categories."

In any event, this doesn't mean Walgreen's won't slim down its operations at some point. Indeed, CEO Rosalind Brewer recently emphasized that Walgreens will continue to seek strategic divestments. At the same time, Brewer insisted that Walgreens will build out its Walgreens Health business, which is "expected to be a significant percentage" of the company's earnings growth. This includes its VillageMD platform, which provides primary care services.

Certainly, it will be interesting to see how Walgreens Health, which generated sales of $596 million in the third-quarter of 2022, enhances the company's top and bottom lines in the coming quarters. If Walgreens Health's objective is to "deliver improved health outcomes and lower costs for payers and providers," this business could become a core part of Walgreens' business during a time of high inflation and, frankly, a strained healthcare system.

The bigger picture for Walgreens, then, seems to involve measured growth and reasonable recovery prospects. Recent declines in sales and earnings should be duly noted but also considered in context -- and if forward-thinking investors can see a strong value where others don't, Walgreens stock may be attractive today and re-rated in due time.