Feb. 26 marked the second major shakeup in the Dow Jones Industrial Average in the last five years. The other was when Salesforce, Honeywell International, and Amgen replaced ExxonMobil, RTX, and Pfizer (respectively) in 2020.

Amazon (AMZN 3.43%) just replaced Walgreens Boots Alliance, which increased the retail representation in the Dow after Walmart (WMT -0.08%) issued a 3-for-1 stock split. The addition of Amazon was possible because the tech giant split its stock in the summer of 2022. At a price in the low $180-per-share range, Amazon will be an average-weighted stock in the Dow, similar to Apple. Walmart is now one of the least-weighted stocks in the time-tested index.

Amazon's inclusion makes it the third "Magnificent Seven" stock to join the Dow (the other two are Microsoft and Apple). It also adds more e-commerce and cloud infrastructure to the Dow as these two industries make up a growing share of the economy.

But just because a stock is joining the Dow doesn't mean it's automatically worth buying. Let's determine if Amazon or Walmart, both hovering around all-time highs, are worth a look.

A person sitting on a chair with a laptop computer.

Image source: Getty Images.

Amazon is too focused on sales growth

Amazon is nothing short of an incredible business. The company has expanded beyond e-commerce to become a diversified giant in entertainment through Amazon Prime Video and Twitch, cloud infrastructure through Amazon Web Services (AWS), and even advertising. According to Statista, AWS commands a 31% market share of global cloud infrastructure revenues -- ahead of Microsoft Azure at 24% and Alphabet's Google Cloud at 11%.

AWS is, without a doubt, the most valuable aspect of Amazon's business. When Amazon fell below $1 trillion in market capitalization in 2022, there was talk that AWS alone was worth $1 trillion. And there's merit behind that view.

AWS generated $90.8 billion in 2023 revenue and $24.6 billion in operating income -- giving the business a 27% operating margin. A price-to-sales ratio of 11 on a business like AWS isn't bad -- if it was growing quickly. But the truth is that AWS' growth has slowed. Compared to 2022, AWS grew sales at just 13.3% and operating income by less than 8%.

Look at the whole business, and Amazon generated $30.4 billion in 2023 net income from $574.8 billion in sales. It's not a direct comparison, but Walmart generated $15.5 billion in net income from $648.1 billion in sales. It has a market cap four times smaller than Amazon's.

My biggest issue with Amazon is that it isn't growing at a blistering rate, and yet, it still conducts its business like a red-hot growth company. Other big tech companies focus on profits, free cash flow, and revenue growth, but Amazon is still all about revenue.

Big tech companies often use some form of stock-based compensation, but the best ones can more than offset it with stock buybacks. Apple, Alphabet, and Meta Platforms have significantly reduced their outstanding share counts over the last five years, whereas Amazon has diluted its shareholders.

AMZN Shares Outstanding Chart

AMZN Shares Outstanding data by YCharts

Amazon is an impressive and powerful business. But it doesn't offer the same balance of growth and value as Microsoft, Apple, Alphabet, and Meta. Again, it would be one thing if Amazon was growing far faster than these companies, but it isn't -- at least not enough to justify its 42 forward price-to-earnings (P/E) ratio, far higher than Microsoft's 35, Apple's 28, Meta's 24, and especially Alphabet's mere 21 or so forward P/E.

An excellent business at a not-so-excellent price

When Walmart sold off after its fiscal Q3 earnings release last November, it looked like a healthy pullback. Walmart had suffered its fair share of setbacks, but the stock had been remarkably stable. Since that report, Walmart stock is up 12.5%. Not only has Walmart more than made up for the November sell-off, but it's now up over 23% in the past year.

To its credit, Walmart is growing sales at a rapid rate, and its margins have recovered to their pre-pandemic levels. Walmart's major concerns were lower margins, supply chain bottlenecks, inflation pressures, and store theft. In a relatively short period, it has made meaningful improvements in all of these categories.

WMT Operating Margin (TTM) Chart

WMT Operating Margin (TTM) data by YCharts

Aside from Walmart's stock split and improving fundamentals, the most significant announcement has been its 9% dividend increase to a post-stock split price of $0.83 per share, or $0.2075 per share per quarter -- the largest raise in over a decade. But even when factoring in the raise, Walmart yields just 1.4%. It also has a P/E ratio over 30 -- which is a premium price for a stodgy, low-margin business with a low yield.

Walmart is a Dividend King, having paid and raised its dividend for over 50 consecutive years. However, there are far better value plays with higher yields.

For example, fellow Dow component and Dividend King Coca-Cola just raised its dividend to a record high. It has a yield above 3% and a P/E ratio of around 24. Walmart isn't growing fast enough to justify half the yield of Coke and a higher valuation. Walmart is the kind of stock worth buying when its valuation makes sense. But that isn't the case now, especially relative to other Dividend Kings.

Great companies, not great stocks to buy now

Amazon was my top stock to buy heading into 2023. And Walmart has long been one of my favorite Dividend Kings. But valuation matters, and the truth is that these phenomenal businesses simply haven't put up the results needed to justify their higher multiples.

This doesn't mean it's worth selling Amazon or Walmart. But investors don't have to look far for better values. I'd take Apple, Microsoft, Meta Platforms, or Alphabet over Amazon right now. And there are plenty of other dividend stocks with higher yields, lower valuations, and comparable growth to Walmart out there. Many of them are in the Dow, like Coke or Procter & Gamble.

All told, Amazon and Walmart are worth holding, but not buying, now.