It's certainly possible for investors to become so fixated on a stock's relative price that they lose sight of the underlying company's prospects. On the other hand, a solid company is an even better investment when you can plug into its stock at a below-average price.

With this as the backdrop, here's a closer look at three companies with great long-term growth prospects as well as stocks that are now too cheap for future retirees to ignore.

1. Dollar General

It seems difficult to imagine any retailer beating Walmart at its own game. The world's biggest brick-and-mortar big-box name faces a unique problem: It can't build stores everywhere.

Two people sitting on their porch.

Image source: Getty Images.

Enter Dollar General (DG -0.41%), which is successful by doing what Walmart won't or can't: establishing smaller stores in the smaller communities where it isn't worth the effort to erect one giant store. As of the most recent look at its reach, about three-fourths of Dollar General's 18,000-plus stores are found in towns with populations of less than 20,000 -- markets Walmart may not find big enough to justify establishing a storefront.

Yet, somehow this collection of smaller, small-market stores still means 75% of the country's population lives within five miles of a Dollar General. In an environment where time is scarce and gas prices may remain perpetually high, driving several miles and then navigating a sprawling Walmart store to only purchase a few items is becoming less appealing.

This idea bears out in Dollar General's fiscal data. While same-store sales slumped 2.8% last year thanks to the fading impact of the pandemic, that's a 2.8% contraction from 2020's whopping 16.3% improvement in same-store revenue. Moreover, same-store sales growth ticked up to 4.2% during the first quarter of this year, prompting the discounter to raise its 2022 revenue growth guidance to a range of between 10% and 10.5%. Its same-store sales outlook was ratcheted up from 2.5% to a range of between 3% and 3.5%.

Inflation or not, these smaller, more convenient stores are a hit with consumers. That's why the company intends to open more than another 1,000 of them this year alone, with several of them expanding Dollar General's reach outside the United States. You can buy the stock while it's priced at less than 20 times this year's projected profits and less than 18 times next year's expected bottom line.

2. Ford Motor

It may be an iconic name, but Ford Motor Company (F -1.92%) is also seen as a has-been by a bunch of investors. Combustion engines are the past. Electric vehicles (EVs) are the future, which favors names like Nio and, of course, Tesla.

Before shelving Ford for good, however, you might want to take a closer look at how much it's adapted to the inevitable future of mobility. Ford's aiming for 40% to 50% of its sales to be electric vehicles by 2030, and with $30 billion worth of funding earmarked for the effort, that goal doesn't seem out of reach.

There's certainly going to be enough EV business to go around, even if Tesla maintains its current lead in the market. The United States Energy Information Administration believes there will be 672 million electric vehicles navigating the world's roads by 2050, way up from a little over 10 million now.

The company's off to a strong start on this front too. April's sales of Ford-branded EVs were up 139% year over year thanks to hot demand for the Mustang Mach-E -- which replaced Tesla's Model 3 as Consumer Reports' preferred EV this year -- and its electric vehicle sales growth accelerated to 222% in May, further boosted by demand for the all-electric F-150 Lightning that saw its first consumer deliveries just last month. They're still a relatively small part of Ford's total revenue, but these appear to be the EVs many consumers have been waiting for.

Ford shares are priced at a mere 7.1 times this year's expected earnings, and 6.4 times next year's estimated bottom line.

3. Goldman Sachs

Finally, add investment bank Goldman Sachs (GS 1.79%) to your list of cheap stocks that could help you retire even earlier than you were intending. Priced at less than nine times 2022's projected profits, there's tons of room for this ticker's valuation to grow.

Yes, those profits in question are likely to roll in about a third lower than 2021's bottom line, when the company's investment banking business was roaring. Consulting firm EY reports last year's IPO market reached a record-breaking 2,388 deals to raise a record-breaking $453 billion for companies looking for public funding. And those numbers don't include the record-breaking $5.8 trillion worth of mergers and acquisitions Refinitiv says were completed last year.

Both are stunningly tough acts to follow, so the market isn't even coming close to following suit. In fact, Goldman's projected 2023 bottom line is only expected to be a hair better than 2021's projected per-share profit of $38.25. Rising interest rates intended to combat inflation may even stifle the economy and this expected earnings growth, perhaps without actually taming inflation while it does (which doesn't exactly work in the investment banking industry's favor either).

Take a step back and look at the bigger picture, though. While the Goldman Sachs name doesn't quite turn heads the way it used to, it's still viewed by most as Wall Street royalty thanks to its ability to push through even the leanest of times. Long-term investors should also know that COO John Waldron recently made a point of explaining how Goldman is looking to diversify its operations so it's less reliant on the highly cyclical capital markets business. There's no reason to think the tenured company won't be able to achieve that goal.