Many companies are struggling under the weight of economic pressures such as inflation. What's more, things could get even worse within the next year: We may or may not enter a recession in the next 12 months, and further interest rate increases could harm corporations' bottom line. It's hard to stay calm amid these challenges, but investors need to focus on the long term.

Even if a company faces headwinds today and will continue to do so in the next few quarters, that's no reason to panic sell. Let's look at two companies that have lagged the market lately but could be major winners in five years and beyond: Etsy (ETSY 0.49%) and Pinterest (PINS -0.64%).

ETSY Chart

ETSY data by YCharts.

1. Etsy remains a solid long-term opportunity

Etsy is an e-commerce platform focusing on handmade and vintage goods and items. This hasn't been a great year for e-commerce, as the pandemic-related tailwind for this space has came to a screeching halt. Add 40-year-high inflation to this dynamic, and Etsy, whose rare goods aren't known for being cheap, looks particularly vulnerable. 

Still, the tech company has managed relatively decent financial results. In the third quarter, the company's revenue increased by 11.7% year over year (YOY) to $594.5 million, coming in above the company's most optimistic prediction of $575 million.

Although Etsy's gross merchandise volume (GMS) -- the total value of transactions performed on its platform -- decreased by 3.3% YOY to $3 billion, it came in slightly above its mid-point guidance of $2.9 billion. What's more, putting aside currency exchange rate fluctuations, GMS grew by 0.7% compared to the year-ago period.

The bad news is that Etsy reported a net loss of $963.1 million. However, it was entirely due to impairment charges of $1 billion related to acquisitions, proof that the company overpaid for these transactions. What's more, the company's active buyers and sellers both dropped slightly YOY. 

The drop in active buyers may be due to economic troubles and customers redirecting more money toward goods considered "essential," a category that hardly includes vintage items. This issue may continue to weigh on Etsy in the fiscal year 2023, but it's hardly a death sentence for the company. 

Etsy's active buyers exploded during the pandemic, and it's not surprising to see that number receding a little bit now given the state of the economy. Things should stabilize over the long run, especially given that the e-commerce industry has a bright future. Some say it will be worth $9.09 trillion by 2027, registering a 14.7% compound annual growth rate (CAGR) through then.

Etsy sees a massive $2 trillion opportunity, and it has barely started to scratch the surface of it. And the company's platform has built a reputation for being a leader in its niche of vintage and handmade goods; it gains in value as more people use it because that attracts even more like-minded users to the platform.

That's one more reason why Etsy's prospects outweigh the challenges it is currently facing.

2. Pinterest has distinguished itself from other social media giants

As a social media specialist, Pinterest is different from its competitors. The company's platform does not focus on keeping in touch with friends and family members or even voicing personal opinions on various topics. Instead, users on Pinterest discover images that help them fuel their creative endeavors, from home decor and fashion to cuisine and art. 

Pinterest makes revenue from ads, and lately, companies have decreased ad spending, harming social media platforms like Pinterest. Moreover, the company's user growth has been practically non-existent since the second quarter of 2021. But Pinterest is still growing its top line, unlike some of its peers in this space.

The company's revenue increased by 8% YOY in the third quarter to $684.6 million. That's despite Pinterest's monthly active users remaining flat at 445 million compared to the year-ago period. The company owes its top-line increase to growing average revenue per user (ARPU), which came in at $1.56 for the year, 11% higher than the prior-year quarter.

Pinterest will continue to focus on growing its ARPU. Notably, the company is looking to increase engagement by improving its search algorithm and allowing users to find and interact with the content they find to be the most relevant for their purposes.

The company's monetization efforts outside the U.S. are still relatively new compared to its domestic initiatives. That's good news for Pinterest's future as it shows plenty of room to continue improving its ARPU and revenue. Furthermore, I think Pinterest's user growth will pick up once pandemic-related dynamics subside.

However, one worry for Pinterest is the bottom line. The company's net loss in Q3 came in at $65.2 million, compared to the net income of $94 million reported during the prior-year quarter. Rising expenses are to blame here, and inflation probably isn't helping.

Still, Pinterest has plenty of opportunities as the online advertising market continues on its upward path, clocking in a CAGR of 17.2% through 2027. Remember, Pinterest is growing its revenue, even when other social media giants saw top-line drops. This speaks volumes about its ability to profit from this industry in the years to come.