There's an old investing truism that says the market almost always gets a company's valuation right -- over the long term.

But in the short term (which can last for several years), good companies can get overlooked -- and that can create some nice investing opportunities. We asked some of our Foolish contributors to single out the companies they see as especially undervalued by the market right now. Here's why they think the market has overlooked the potential at Celgene (CELG)Under Armour (UA -11.87%) (UAA -13.03%), and General Motors (GM 0.34%) -- and how investors could benefit from buying now. 

Barra is shown speaking while standing next to a white Chevrolet Bolt EV equipped with self-driving sensors.

Two big reasons to get excited about GM: A self-driving Chevy Bolt and CEO Mary Barra. Image source: General Motors.

An old giant that's out-disrupting its would-be disruptors

John Rosevear (General Motors): It seems like tech analysts can't stop telling us how the traditional automakers are toast. Electric vehicles and self-driving systems from upstart Silicon Valley companies are going to disrupt the old giants just like Apple's iPhone crushed the older cellphone makers -- or so the story goes.

GM CEO Mary Barra has different ideas, and already GM is out in front of Silicon Valley on some key fronts. Tesla gets the hype (and the wild valuation), but it's GM that was the first to ship a mass-market electric vehicle with over 200 miles of range, the Chevrolet Bolt. And it's very likely that GM will be the first to ship a mass-produced self-driving vehicle in the coming months, when it produces a big batch of self-driving Bolts for ride-hailing duty with Lyft.

Did I mention that GM owns 9% of Lyft? Or that it owns 100% of Maven, an app-driven urban car-sharing company? Or that the Bolt was designed from the ground up to serve as a platform for future tech including (but not limited to) GM's homegrown self-driving system, and optimized for fleet use in urban settings with companies like Lyft and Maven?

More than just about any automaker, GM has positioned itself to thrive and profit handsomely in the self-driving shared-mobility future. Meanwhile, its core business continues to generate huge profits in the U.S. and China, thanks to the popularity of GM's well-regarded line of SUVs and trucks. And Barra and her team have been relentless about cutting marginal businesses -- including selling off GM's money-losing European operation -- and investing in new products to maximize profitability now and boost it significantly in the future.

So why is GM selling at just 5.4 times its expected 2017 earnings? It's partly because of concerns about the U.S. new-car market, which looks to be past its cyclical peak. But it's also because of that narrative I outlined above. 

Sooner or later, Wall Street (and those tech analysts) are going to catch on to what GM is doing -- and sooner or later, its stock price should jump. Buy it now, reinvest GM's nice (and sustainable) 4.6% dividend, and you could enjoy a handsome payoff in time.

A biotech worthy of more excitement

Keith Speights (Celgene): So far in 2017, Celgene is underperforming the S&P 500 index. Argus Research analyst David Toung even downgraded the big biotech stock, expressing concerns about Celgene's reliance on blood cancer drug Revlimid for much of its revenue. The market just hasn't been excited about Celgene lately. But it should be.

Toung is right that Celgene derives around 64% of its total revenue from Revlimid. However, Revlimid generated 66% of Celgene's revenue in 2013, a year in which the biotech's share price more than doubled. The drug accounted for 65% of total revenue in 2014, when Celgene stock jumped 30%. What's so bad about where Celgene is now with Revlimid?

Worries about too much reliance on one drug also miss an important point: Celgene could soon have plenty of big winners on the market. The biotech expects to report results from 19 late-stage clinical studies over the next couple of years. Celgene stands a good chance of winning approval for seven drugs between now and the end of 2020 that could have potential for annual sales of at least $1 billion.

The first of those drugs could be on the market next year. In February, Celgene reported great results from a late-stage study of ozanimod in treating multiple sclerosis. The company expects to submit the drug for approval by the end of the year. Ozanimod could generate peak annual sales of $2 billion in the indication, with more added to that if it also wins approval for treating ulcerative colitis.  

In the meantime, Revlimid should be in good position to keep making more money for years to come. Continued strength for Revlimid and other blockbuster drugs Pomalyst and Otezla combined with a loaded pipeline prompted me to make the case not long ago that Celgene should be a top biotech stock for the next decade or more. I still think that's the case. 

An underrated apparel company

Keith Noonan (Under Armour): There are few stocks that the market has soured on more than Under Armour. The company's Class A shares trade roughly 45% lower than they did a year ago while the S&P 500 index has climbed 17% over the stretch. In fact, the company was one of the S&P 500's biggest losers in 2016, and also the index's biggest loser in the first quarter of 2017. It's not hard to understand some of the negative sentiment that now surrounds the company, but the market appears to be undervaluing Under Armour's growth potential.

While weak domestic performance due to the closing of retail sports outlets and sluggish sales for key product releases are certainly disappointing, the apparel company still has compelling strengths and substantial growth avenues ahead. Under Armour's opportunity to increase business overseas is particularly noteworthy, with only around 20% of revenue currently derived from international sales and 52% year-over-year sales growth in the last quarter pointing to significant long-term expansion.

The company's push to better incorporate technology across all rungs of its business is also promising. While there's not much to point to in terms of material contribution at the moment, increasing use of data analytics to better understand and reach customers as well as the company's sizable investment in connected fitness technologies are the type of forward-thinking moves that could translate to lasting advantages.

Under Armour might not be a fit for risk-averse investors, but it has lots of room to run, and the market doesn't seem to be giving it the credit that it's due.