What happened

Shares of United Parcel Service (UPS 1.81%) have sputtered through most of 2022, weighed down by concerns about a slowing economy. But upbeat comments from its arch rival, coupled with a well-timed analyst upgrade, provided a lift to the stock last month.

Shares of UPS gained 13.1% in November, according to data provided by S&P Global Market Intelligence, on investor hope that the worst is behind us.

So what

This is a tough market for a global transportation company. Efforts in the U.S. and overseas to battle inflation are showing signs of slowing the global economy, which would lead to less demand for logistics and shipping services. Shares of UPS had lost about 25% of their value in 2022 heading into November.

But comments from FedEx, a company that has felt the global slowdown more acutely than UPS, has helped to calm nerves around the transport sector. FedEx shares surged in November after the company told investors it was having success streamlining costs and saw demand trends stabilizing, albeit at a reduced level.

UPS shares moved in tandem with FedEx in early November as investors assumed the comments on the macroenvironment would apply to all companies. UPS saw gains later in the month when the stock was upgraded to "buy" at Deutsche Bank, with a price target of $220.

Deutsche analyst Amit Mehrotra wrote that while it is easy to be neutral, at best, about UPS in the current environment, times like these are exactly when investors should be buying in.

Now what

Although the FedEx news got more attention, it is Mehrotra's comments that should resonate with long-term-focused investors. The current operating climate is difficult, but UPS has been a long-term winner because of its ability to navigate through tough times and come out of down cycles in a position to capitalize. Nothing has happened in 2022 to suggest that won't be the case this time as well.

Businesses like UPS will never be immune to the business cycle, and with Wall Street's inevitable focus on the next six months instead of on the long-term picture, the stock tends to get sold off during these periods. If history is a guide, these are buying opportunities, and investors were taking advantage in November.