Walmart (WMT -1.23%) holds a sizable advantage over many stocks. Its strong financials and diverse business make it a threat in any industry it moves into, including healthcare. But deciding if it's a better investment than well-known pharmacy retailer CVS Health (CVS 1.10%) involves more than just looking at what the two companies have achieved so far or the size of their sales numbers.

Investors also need to look at what's ahead, whether there are better growth opportunities for CVS or Walmart, and which stock is more likely to produce favorable returns for investors in the future. Let's take a look at how these two companies compare based on their growth prospects as well as their current valuations to assess which one investors are better off buying today.

Walmart Health could play a large role in an already massive business

Earlier this year, investors learned that Walmart remodeled its store in Calhoun, Georgia, to offer healthcare services at a second U.S. location. With convenience and low price being key factors for consumers, including offering services for patients with no insurance, it's easy to see the appeal of the big-box retailer. And if there's one thing Walmart can compete on, it's price. With some services like checkups and dental cleaning costing as little as $25 or $30, Walmart has the potential to lure many patients who can't afford healthcare elsewhere. Without insurance, patients can expect to pay traditional clinics at least $100 for a cleaning, so Walmart Health is much more affordable.

There's certainly an opportunity for Walmart to disrupt healthcare and gain significant market share, but it's still unclear how seriously the company will pursue the segment. With more than $9 billion of cash on its books as of Jan. 31, the company can afford to invest some money into the opportunity to see how well it can do. While there's no doubt demand would be there for low-cost healthcare, profitability is an entirely separate matter -- one that will likely affect how much of an investment Walmart makes into healthcare over the long run.

Medical products on pharmacy shelves

Image source: Getty Images.

Even if it proves to be unsuccessful, Walmart still provides many other services, including pharmacy, that give it exposure to healthcare and that can help it continue to grow. In its most recent fiscal year, 2020, Walmart generated $524 billion in revenue, and operating income was above $20 billion.

And while the coronavirus may impact in-store traffic, there are plenty of alternatives for customers. The company offers convenient delivery options from its website with its NextDay delivery service from accessible by 75% of the U.S. population and same-day grocery delivery is also available in most major cities as well. 

Getting into healthcare might be attractive to the retail giant because its sales growth was just 1.9% this past year, and comparable U.S. sales were up just 2.8%. Offering healthcare services could significantly improve those numbers and the foot traffic in its stores. Investors will want to keep a close eye on whether the company expands healthcare services into more locations to help gauge whether it's a successful endeavor or not.

CVS is remodeling, too -- but will it be enough?

With competition on the rise, CVS knows it has to change its business not just to grow, but to stay relevant. It's been closing stores to shed some overhead and improve its financials, and it's also looking at ways to offer its customers services they can't buy online. As of November 2018, CVS' deal to acquire health insurer Aetna is complete, enabling the company to offer its customers a more complete healthcare experience that goes beyond products you could find at any pharmacy or online retailer.

CVS is transforming 1,500 locations by the end of next year into HealthHubs that will allow customers to take part in yoga, access dietitians, manage chronic conditions, and take advantage of other services.

Although the company's revenue rose by 32% in 2019, that was mainly due to its acquisition of Aetna. To generate significant growth moving forward, CVS will likely have to find ways to bring more customers into its stores especially when competing with online retailers and pharmacies. The proof will be in the success of the HealthHub locations in bringing in more traffic to prove whether or not the move pays off for CVS.

Why investors should go with CVS today

Over the past 12 months, both CVS and Walmart have outperformed the S&P 500.

CVS Chart

CVS data by YCharts.

There hasn't been much separating the two stocks, but that could change in the weeks and months ahead. With the coronavirus raising health concerns, it wouldn't be surprising if traffic starts to spike at CVS locations as long as the virus remains a threat and consumers are worried, sending both sales and the stock price up.

Like Walmart, CVS offers a delivery option for customers to receive their prescriptions and other in-store items at home. And in the majority of its locations, CVS also offers same-day delivery.

Currently, CVS's stock trades at a forward price-to-earnings (P/E) multiple of less than nine, compared to Walmart's forward P/E ratio of 22, making it the better value buy for investors. While CVS may lack the diversification Walmart offers, that also makes CVS less risky -- especially when it comes to exposure to traditional retail, where fears of the coronavirus may keep many shoppers at home. In addition, CVS's dividend yield of over 3% is also higher than Walmart's, which pays 1.9% annually and is in line with the S&P 500 average of 2%.

Overall, CVS is a better buy for both the short and long term.