It's been a difficult decade for investors in retail and pharmacy company Walgreens Boots Alliance (WBA 1.02%). The stock has been trending downward for years as persistent challenges soured market sentiment.

An analyst at TD Cowen remains optimistic that Walgreens stock could see a major rebound. While TD Cowen reduced its price target from $37 to $35 today, it maintained a buy rating on the stock. Based on the current stock price, the new price target implies an upside of about 87%.

Favorable risk/reward

While the TD Cowen analyst doesn't expect Walgreens' results to necessarily improve, a favorable risk/reward trade-off is at the foundation of the lofty price target. Walgreens narrowed its full-year guidance in March to reflect a "challenging retail environment in the U.S." and a few other issues. This new target is achievable, according to TD Cowen.

Walgreens now expects to report adjusted earnings per share between $3.20 and $3.35 in 2024, while it continues to expect the U.S. healthcare business to break even on an adjusted EBITDA basis. The bottom line has fallen off a cliff over the past few years. Walgreens reported adjusted EPS of $4.91 in 2021.

While earnings are in decline, the TD Cowen analyst isn't wrong about a sizable potential upside if the company can hit its targets. At the midpoint of Walgreens guidance range, the stock trades at a price-to-earnings ratio below 6.

Is Walgreens stock a buy?

While an 87% surge in Walgreens stock is certainly possible, buying a stock solely because its valuation has been beaten to a pulp can be a recipe for disaster. Walgreens stock has looked cheap for years, and the only thing investors have gotten in return is a tumbling stock.

Walgreens might be a solid turnaround play. The company appointed a new CEO in October, and he's already made some tough decisions like slashing the dividend to preserve cash. But the stock still looks risky.