Many stocks rallied over the past year as rational investors finally looked beyond the recent macro headwinds. However, plenty of other stocks were still left behind as the bulls rushed toward the market darlings instead of the underdogs.

But as Warren Buffett famously said, investors should always be "greedy when others are fearful" and buy "quality merchandise when it's marked down." Here are five discount stocks that fit that profile: Rivian (RIVN 6.10%), Upstart (UPST 2.76%), Opendoor (OPEN 3.38%), DigitalOcean (DOCN 3.30%), and HP (HPQ -0.46%).

Colored arrows rise out of a person's head.

Image source: Getty Images.

1. Rivian Automotive

Rivian was one of the market's hottest electric vehicle stocks in late 2021, but it's plunged about 90% from its all-time high. It ran out of juice as its production slowed down, it racked up more losses, and rising rates popped its bubbly valuations.

But after that steep decline, Rivian trades at less than 2 times next year's sales. That's a low valuation for a company that expects to more than double its annual production to 52,000 vehicles this year. It's also in the process of producing 100,000 electric delivery vans for its top investor, Amazon.

Analysts expect Rivian's revenue to surge 166% this year and rise 41% to $6.2 billion in 2024. It's still deeply unprofitable, but its $9.1 billion in cash, cash equivalents, and short-term investments will buy it a lot of time to ramp up its production.

2. Upstart Holdings

Another hot stock in late 2021 was Upstart, which uses an AI-powered lending platform to help banks, credit unions, and auto dealerships approve loans with non-traditional data like a person's education, standardized test scores, and work history.

That business model flourished when interest rates were low, but it flopped as rising interest rates drove its customers to take on fewer loans and its partners to scale back their loans. That shift caused Upstart's revenue to dip 1% in 2022, and analysts are bracing for a 40% decline this year. As a result, its stock has fallen about 90% from its all-time highs.

However, Upstart's prospects should improve as interest rates stabilize. In 2024, analysts expect its revenue to rise 29% as it returns to profitability. And at 5 times next year's sales, it certainly looks a lot cheaper than it did in late 2021.

3. Opendoor Technologies

Another victim of rising interest rates was Opendoor, the online real estate company that streamlined home sales by making instant cash offers for homes, repairing those properties, and relisting them for sale on its online marketplace. It also aimed to save sellers and buyers money by cutting real estate agents out of the loop.

Opendoor's sales surged during the post-pandemic housing boom in 2021 and 2022, but plunged over the past year as rising rates throttled the housing market. Analysts expect its revenue to plummet 56% this year and decline another 12% in 2024. It's also expected to remain unprofitable for the foreseeable future.

Opendoor also trades about 90% below its all-time high, but it looks dirt cheap at just 0.6 times next year's sales. Therefore, this beaten-down stock could be poised for a big comeback if interest rates stabilize and the macro environment improves.

4. DigitalOcean

DigitalOcean's stock is down more than 30% since its public debut in March 2021. The cloud infrastructure services provider aimed to carve out a niche in the market by offering tiny "droplets" of servers to smaller businesses, but the bears claimed it would be rendered obsolete by larger public cloud platforms.

Yet DigitalOcean continued to grow. From 2020 to 2022, its revenue rose at a compound annual growth rate of 35%. Analysts expect its revenue to rise 20% this year, even as the macro headwinds drive companies to rein in their cloud spending.

DigitalOcean's margins are also expanding, and it looks cheap at 5 times next year's sales and 19 times its forward adjusted earnings. That's why this little niche cloud player could still have a lot of upside potential in a healthier market.

5. HP

Lastly, HP's stock declined about 16% over the past two years as the PC and printing markets experienced a post-pandemic slowdown. The bulls had initially expected the commercial segment's recovery to offset its weaker sales of consumer products, but rising rates and other macro headwinds disrupted that recovery.

However, HP's core businesses stabilized sequentially in its latest quarter, and it expects the PC market to bottom out and kick off a new growth cycle with the arrival of new PCs optimized for Windows 11 and artificial intelligence (AI) applications. It also continues to aggressively cut costs and streamline its portfolio to boost its profits.

Analysts expect HP's revenue and adjusted earnings per share to rise 2% and 5%, respectively, in fiscal 2024 (which started in November) as its core markets stabilize. Its low forward multiple of 9 and high forward yield of 3.6% should also limit its downside potential until its growth accelerates again.