After a strong close in 2023, the stock market hasn't exactly lit the world on fire in early 2024. If there's an upside to a less-than-stellar market, though, it's that it opens up more opportunities for investors to find companies whose shares are trading at value prices.

When all is said and done, a share of stock is simply an ownership stake in a company. Over time, that company's ability to generate cash will play a huge role in how its stock performs. When you can buy your claim on those future cash flows at a low price, you set yourself up with the potential for strong returns over the long haul.

With that in mind, if you've got $5,000, here are three value stocks to consider buying and holding for years.

A person smiles while fanning out cash in front of their face.

Image source: Getty Images.

1.  A spirits company people turn to in all sorts of economic times

Diageo (DEO 0.24%) is the British company behind such globally popular alcohol brands as Guinness, Johnnie Walker, Tanqueray, and Baileys. While those brands may conjure up images of nights on the town, the reality is that they all are consumed in homes as well as at bars, pubs, and restaurants.

From Diageo's perspective, it doesn't matter all that much whether a consumer is enjoying the product in public or in private. If the bottle of alcohol contains a Diageo brand, then Diageo will benefit from the related purchase transactions.

It's that sort of dynamic that makes the spirits business one of the more recession-resistant ones out there. Of course, that means that Diageo isn't likely to be the world's fastest-growing company in boom times, but it also means that its earnings are also not likely to collapse in a tough economy.

Trading at less than 18 times the company's projected earnings, Diageo looks like it's trading at a reasonable value for a company with long-term steady prospects. Add around a 2.8% yield, and investors stand to get a reasonable payment as they wait for those longer-term prospects to materialize.

2. North America's energy pipeline behemoth

Enbridge (ENB -1.21%) owns and operates one of North America's largest pipeline systems. It moves around 20% of all natural gas consumed in the United States and lays claim to the world's longest crude oil and liquids pipeline.

While the push for more renewable energy is raising questions as to the very long-term future of pipeline companies like Enbridge, over the next few decades, its prospects look solid. In the U.S. Energy Information Administration's 2023 outlook, oil and natural gas usage is expected to remain about steady at least through 2050.

Steady demand for decades to come plus an already large infrastructure in place is a great recipe for a business to trade with a reasonable valuation and offer shareholders a healthy dividend. That's exactly the profile that Enbridge has.

Thanks to its recently announced 29th consecutive annual dividend hike, Enbridge now offers investors a strong 7.3% dividend yield. That dividend is well supported by the company's operating cash flows. When added to a valuation of around 18 times the company's projected earnings, you get a company at a decent price point to go along with that solid and growing income.

3. Heads, you win; tails, you still don't lose

Grocery store giant Albertsons (ACI 1.10%) is in the process of being acquired by an even larger grocery chain, Kroger. Albertsons' shares are being acquired for $34.10 per share, less a $6.85-per-share special dividend that was already paid to Albertsons shareholders. That nets to $27.25 per share.

At a recent market price of $23.04 per share, Albertsons' shares are trading about 15% below that buyout price. A decision on that merger is expected soon. If it's allowed to complete, there's a clear upside to Albertsons shares.

If, on the other hand, the merger gets blocked by regulators, Albertsons' shares still look reasonably priced as an independently operating company. Trading at less than 9 times the company's expected earnings and with those earnings expected to grow by about 8% annualized over the next few years if it stays independent, its shares look downright cheap.

If the buyout closes, Albertsons' shareholders get a nice, near-term upside. If it doesn't, they get a solid business at a reasonable price.

Get started now

As great as it is to find solid companies trading at reasonable prices like Albertsons, Enbridge, and Diageo appear to be, the reality is that the market rarely lets bargains last for long. As a result, if they look like they might be the type of companies you'd like to buy at prices you're willing to pay, make today the day you consider them for your own portfolio. You just might find that $5,000 invested across them could result in you owning shares in decently valued companies with solid long-term prospects.