The market's been relentlessly bullish of late, with the S&P 500 up a hefty 20% just since its recent low in mid-March. Every time it seems like another new 52-week high for the index just isn't possible, the market surprises us.

The big rally has driven lots of companies back to extremely pricey valuations, of course. It's easy to doubt there's much more near-term upside left for many of these stocks. Bargains now are few and far between.

If you're willing to do a little digging, though, there are some stocks you can still reasonably afford to step into. Here are three of the best of them.

1. IBM

There's no denying that International Business Machines (IBM -1.05%) -- you know it better as IBM -- isn't what it used to be. "Big Blue" used to be the powerhouse of the tech sector. Then, software became more important than hardware. After that, competitors figured out how to succeed in the shrinking hardware business. Then cloud computing and mobile took center stage. These were all evolutions in the marketplace that IBM wasn't quite ready for.

If you think it's a lost cause, though, think again. Leveraging its 2019 acquisition of Red Hat and following 2021's spinoff of its managed infrastructure business (now called Kyndryl), IBM is fully repositioned as a cloud services and software operation. Artificial intelligence and cybersecurity are also in its wheelhouse.

Admittedly, it's still only a shell of its former self. Double-digit percentage revenue growth isn't in the cards for it anytime soon, if ever. Its business model is increasingly a subscription-based one that trades off big growth for a consistent and predictable top line. Indeed, more than half of its revenue is now recurring revenue driven by subscriptions to its software and services.

The new approach is working, though. Its second-quarter operating cash flow of $2.6 billion was twice that of the prior-year quarter, extending what has turned into a healthy growth streak. IBM maintains that it's on course to generate $10.5 billion worth of free cash flow for the year versus 2022's $9.3 billion, thanks to a shifting business model that promotes recurring sales of software.

You can step into this stock now while it's priced at less than 16 times next year's projected earnings. But, better than that, you can dive in while its sustainable, well-funded dividend yields more than 4.7% at the stock's current price. One rarely finds yields that big within the tech sector.

2. Novo Nordisk

When investors think of biopharma or biotech stocks to buy, Novo Nordisk (NVO 0.84%) doesn't often leap to mind. More recognizable names like Amgen or Merck are the usual go-to choices.

Don't let its relatively off-the-radar status keep you from considering it. Novo Nordisk is a powerhouse, boasting a $367 billion market cap and dominance of its core market.

That's diabetes, by the way. The company's diabetes therapies, such as Tresiba, Mixtard, and NovoMix insulins, account for more than half of worldwide sales of such treatments. It is doing pretty well with obesity treatments and GLP-1 (glucagon-like peptide) agonists as well. All told, last year's top line improved to the tune of 26%, with comparable growth in the cards for this year.

The stock isn't cheap. It trades at more than 32 times this year's estimated earnings and more than 28 times next year's projected earnings.

This is one of those cases, however, where you have to accept paying a premium for quality and strong growth prospects.

And there's little doubt that its growth prospects are strong. The International Diabetes Foundation believes the worldwide number of adults diagnosed with diabetes will swell from the current count of 537 million to 643 million by 2030, with many of them becoming able to treat the condition for the first time during that time frame.

3. Target

Last but not least, add Target (TGT 0.18%) to your list of stocks you'll be glad you bought at its current price. It's trading nearly 50% below its mid-2022 peak, down 25% from its early 2023 high, and knocking on the door of a new 52-week low.

Even if you only keep loose tabs on the retailer, you likely know Target is struggling to shake off its post-pandemic funk. It has been plagued by a combination of inflation and economic malaise.

Whereas Walmart focuses more on selling the basics at rock-bottom prices, Target tends to tilt a bit more toward discretionary purchases. That's a problem when consumers have less to spend on those discretionary items.

CEO Brian Cornell even conceded during May's first-quarter earnings conference call that "pressure from inflation and rising interest rates affected the mix of retail spending in Q1 with a further softening in discretionary categories in the March and April time frame." This is a big reason the company's first-quarter overall sales grew by an anemic 0.5% while same-store sales grew by a similarly lethargic 0.7%.

Meanwhile, the company fears shoplifting will shave an additional $500 million off this year's bottom line compared to last year's theft-related losses. For perspective, Target turned 2022's $107.6 billion worth of sales into $3.2 billion worth of net income, down from 2021's bottom line of $7.3 billion on sales of $104.6 billion.

All of this bad news is arguably already baked into the stock's price, however, and then some. Shares are now priced at a little over 13 times next year's expected earnings of $10.17 per share, which would be up 24% from this year's estimated earnings of $8.21 per share. That matters simply because much of what ails the retailer is temporary, and management knows how to handle the rest. It just needs more time to make it happen. And the stock could start to perform better long before it's obvious that those fixes are in place.