With the major indexes near all-time highs and with valuations well above the historical average, cheap stocks are like needles in a haystack. Finding compelling value is much harder today than it was a few years ago, and the post-election rally hasn't helped.

There are still some cheap stocks available, although they come with trade-offs that help explain their beaten-down valuations. General Motors (NYSE:GM) and Bed Bath & Beyond (NASDAQ:BBBY) are both undeniably cheap, but the details are important for investors considering buying shares of these companies. Here's what you need to know.

Image source: Getty Images.

Too much pessimism

General Motors stock, at first glance, appears shockingly cheap. The company expects to produce adjusted earnings of around $6 per share this year, putting the stock price at just six times earnings even after its post-election rally.

The story isn't quite so simple, though. GM derives most of its profits from North America, and the U.S. auto market looks like it's finally plateauing after years of robust growth. This could lead to more intense competition and greater promotional activity, which would eat into GM's profits. It's very possible that GM's earnings will peak in 2016, making the stock not as cheap as it seems.

GM's electric Chevy Bolt. Image source: General Motors.

Another problem is the uncertainty produced by the election of Donald Trump. A Chinese official reportedly warned on Dec. 14 that China may fine an unnamed U.S. automaker for monopolistic behavior, a move that could be interpreted as payback for Trump's comments on Taiwan. China is an important market for GM, and any uncertainty is a concern.

Despite these issues, I think the market is being too pessimistic on GM. The stock would still be attractively priced even if the company suffered a steep decline in earnings. A downturn that plunges GM into the red is certainly possible, but the company is far more efficient today than it was prior to its reorganization during the financial crisis. GM stock isn't as cheap as it appears on the surface, but it's still undeniably cheap.

An undervalued retailer

Shares of Bed Bath & Beyond have surged since bottoming out prior to the election, but the stock has still taken a beating over the past few years. Margins have been contracting, in part due to an overreliance on sending 20%-off coupons to its customers in order to drive sales. On top of that issue, the threat of e-commerce looms large.

Bed Bath & Beyond expects to produce between $4.50 and $5.00 in per-share earnings this year, roughly in line with its results from the past few years. That puts the stock's price-to-earnings ratio at 10. Aggressive share buybacks have allowed the company to prevent earnings per share from falling despite slumping margins, but this tactic won't work forever. Bed Bath & Beyond needs to find a way to stabilize its bottom line sooner rather than later.

The iconic 20%-off coupon. Image source: Bed Bath & Beyond.

The company is testing out an annual membership service as a way to cut its dependence on coupons. The $29 annual fee includes a permanent 20% discount and free shipping. If successful, the program could boost customer loyalty while creating additional revenue for the company, all while maintaining the 20% discount that customers know and love.

Bed Bath & Beyond is facing some challenges, but even after years of slumping profitability, it still manages an operating margin in excess of 10%. The company's long track record of success should give investors some confidence that the coupon problem can be solved. Trading at just 10 times earnings, Bed Bath & Beyond looks like one of the best deals in retail.