When equity markets drop, it is easy to focus on the here and now, ignore companies' long-term prospects, and resort to panic selling. But investors must never forget that holding onto (or buying shares of) solid corporations when markets are down is one of the keys to successful long-term investing.

With all three major U.S. market indexes still in the red over the past 12 months, there are intriguing companies whose shares are down big time over this period, and some of them are worth investors' hard-earned money. Here are two examples: Veeva Systems (VEEV -0.58%) and Airbnb (ABNB -3.18%).

1. Veeva Systems

Veeva Systems is a life sciences-focused cloud computing company. The services it offers are mission-critical for its customers and an integral part of the process many life sciences companies have to go through to launch their products on the market in a highly regulated industry.

The usefulness of Veeva's services hasn't stopped investors from selling off the stock lately; shares are down by 35% in the past year, likely due in part to rich valuation metrics. Veeva Systems' forward price-to-earnings (P/E) ratio of 38.2 is about twice the average for the S&P 500.

Also, Veeva Systems' revenue has been growing slower in recent quarters.

VEEV Revenue (Quarterly YOY Growth) Chart.

VEEV Revenue (Quarterly YoY Growth) data by YCharts.

Even so, Veeva Systems' business continues to progress in important ways.

Many of the largest pharmaceutical and biotechnology companies rely on Veeva's cloud solutions, and the company's customer base has consistently grown. Veeva Systems had 1,205 customers as of Jan. 31, 2022, up from 993 the year before and 861 two years prior.

Further, although revenue growth rates have dropped, Veeva Systems has achieved the revenue goals it set for itself. In 2015, the company vowed to rack up $1 billion in revenue in 2020; it got there one year ahead of schedule. And the company is currently (once again) one year ahead of its 2025 goal of $3 billion in revenue, meaning it could hit that mark next year.

What's next for Veeva Systems? There remain plenty of opportunities in the massive $2 trillion industry where its clients do business. The company's track record shows that it can continue attracting new customers thanks to how valuable its services are to life science companies who, in turn, are in the business of developing essential products such as lifesaving medicines.

Meanwhile, Veeva's revenue and earnings will also likely remain northbound. Declining growth rates and rich valuation metrics might be a problem in the short term, but Veeva's leadership in a niche space of the cloud sector should help it deliver solid returns for many years to come. 

2. Airbnb

Airbnb helps facilitate home and vacation rentals through its platform. The company is a leader in this niche of the hospitality industry, and it has been benefiting from the rebound in this market compared to the lows we saw during the pandemic. Airbnb reported solid progress in almost every major metric in the third quarter.

The company's nights and experiences booked increased by 25% year over year to 99.7 million. Airbnb's gross booking value came in at $15.6 billion, 31% higher than the prior-year quarter. The tech giant's revenue of $2.9 billion was 29% higher than that of the third quarter of 2021, while its net income soared by 46% year over year to $1.2 billion.

And all that amid economic problems, geopolitical tensions that led to the company suspending its business in Russia and Belarus, and unfavorable exchange rate dynamics that significantly impacted its financial results. For instance, the company's revenue increased by a much more impressive 36% year over year in constant currency.

Will the company's financial results be as strong this year? Maybe not. The initial euphoria with which people rushed to execute their travel plans after the pandemic halted much of that activity for over a year may eventually die down. Meanwhile, with a forward P/E of about 30, Airbnb's stock isn't cheap either, so there is even more pressure to perform in the near term.

Combining these two factors helps explain why the company's shares have been underperforming despite its strong financial results. But long-term investors should look beyond these issues. Even if the economy throws more curve balls this year that end up harming Airbnb's business momentarily, as long as people continue to travel and need accommodations on the road, Airbnb will be there to help.

Its rentals provide an environment that is, for many, better than traditional hotels. Renting an apartment while on vacation comes with a level of privacy and amenities hotels often don't offer. Further, the value of Airbnb's platform improves as more people use it, granting it a competitive edge. Whatever troubles lie ahead within the next 12 months, Airbnb is well-positioned to provide solid revenue and earnings growth -- and market returns -- for a long time.