Buy straw hats in the winter, when nobody wants them, and sell them in the summer when everybody needs them.
--American billionaire investor Kenneth Fisher

It's repeatedly been shown that the best time to buy stocks is when everyone else runs for the exits. This was true during the worst of the pandemic -- most recently, in 2022, as you can see in the chart of an exchange-traded fund (ETF) indexed to the S&P 500:

SPY Chart

SPY data by YCharts.

Inflation was raging, and many investors sold stocks in a panic. Because I see market drops and economic challenges as terrific opportunities to buy low, I wrote about this then.

This also applies to individual stocks -- not all of them, of course, because some never recover. But it could be time to pounce when one of the world's most iconic brands takes a nosedive. Is this the case with Starbucks (SBUX 0.72%)?

What happened?

Starbucks released earnings for the second quarter of its fiscal 2024 on April 30, and the results weren't great. Actually, they were pretty poor. Year over year, comparable-store sales declined 4%, operating income was off 6% to $1.15 billion, and margins contracted despite rising prices. The result was a sharp drop in the stock price, which is now down more than 15% year to date, as shown below:

SBUX Chart

SBUX data by YCharts.

While rising prices help to compensate for a decline in foot traffic, this is a chicken-and-egg situation: Falling traffic may also result from higher prices. The increase in remote work, competition from local shops, growing national chains such as Dutch Bros, and declining consumer sentiment are significant challenges for Starbucks.

Q2 also spotlighted its strategy in China. The country is a major part of Starbucks' plans for growth, as the North American market is largely saturated. But the struggles in China continue. Comparable-store sales declined a whopping 11% there, driven by geopolitical tensions and a relatively weak Chinese economy.

It's no surprise that the stock plummeted, given the immense challenges highlighted in Q2. But what about the long-term prospects?

Is Starbucks stock a buy now?

Starbucks' management is aware of the obstacles and announced a reinvention strategy in late 2023. The plan includes leveraging its digital footprint by doubling its number of reward members (currently 75 million), working with Microsoft to create personalized customer options, and exploring "just walk out" payment technology. The company plans to expand its footprint in the U.S. selectively with drive-thru-only and other efficient locations, while continuing to expand aggressively overseas.

Finally, management believes it can become more efficient and save $3 billion over the next three years. For context, a reduction in operating expenses of $1 billion in fiscal 2023 would have raised the operating margin more than 3%.

Some metrics suggest that the sell-off is overdone. The price-to-earnings (P/E) ratio is near its lowest since the March 2020 crash:SBUX PE Ratio Chart

SBUX PE Ratio data by YCharts.

The drop also pushed the dividend yield to its highest point since the company initiated the dividend in 2010, including during the height of the pandemic:

SBUX Dividend Yield Chart

SBUX Dividend Yield data by YCharts.

There are definitely challenges now, but this number suggests that the company is in dire straits; it's not. In fact, $2.9 billion in cash from operations was produced through Q2 this fiscal year, compared to $2.4 billion for the same period last fiscal year. And while margins contracted, Starbucks is still quite profitable, reporting an operating income of $2.6 billion through Q2.

Over the same period, Starbucks has repurchased 12.8 million shares of stock for $1.3 billion, compared to 4.9 million shares for $495 million the prior year. The company is authorized to repurchase another 30 million shares. The price drop is a terrific opportunity to do this at a lower cost.

The answer is simple. If you believe Starbucks' business is permanently damaged, the stock is not a buy. If you believe it's still one of the world's premier brands going through a difficult stretch, then the stock is a long-term bargain. I think it's the latter. The turnaround won't be immediate, but investors can enjoy the highest yield Starbucks stock has ever offered in the meantime.