Microsoft (MSFT 0.04%) is the world's second-biggest company, making up 6.3% of the S&P 500 by market cap weight. With that significant weighting, investors might wonder if it's necessary to own Microsoft's stock by itself because most already have a healthy allocation to it through a 401(k) or index funds.

Essentially, it boils down to if Microsoft can beat the broader market over the next three to five years. So let's see if Microsoft can accomplish that feat, as the answer may surprise you.

Microsoft's strong segments are offset by its weaker ones

At this point, it may be easier to name what Microsoft doesn't do. Microsoft Office products have become a staple within the business world, and its cloud computing division is building the future of how companies offload computation resources. It also has a PC division, builds Xboxes, and owns LinkedIn.

It's even trying to get further involved in the gaming business by purchasing Activision Blizzard (ATVI), although that proposed deal is being scrutinized by regulators. However, Japan gave it the thumbs up recently, and the U.K. also looks to be on board. So while this deal is far from done, it's beginning to look like it's primed to go through.

With Microsoft's fingers in multiple industries, it gives the company balance so it isn't affected by a downturn in one industry.

For example, Windows OEM and device revenue both dropped 39% in Q2 of FY 2023 (ending Dec. 31), thanks to weakness in the consumer PC industry.

But that balance also cuts both ways. In Q1, Azure (Microsoft's cloud computing division) grew revenue by 31%, while Dynamics 365 increased sales by 21%. Because the weaker ones offset these divisions, Microsoft only grew revenue by 2% in Q2. That slow growth rate is expected to drag into Q3, with management only guiding for 3% growth.

Earnings per share (EPS) also took a hit, falling 11% in Q2. Slow revenue growth and falling earnings aren't a recipe for success, yet the stock is up around 20% since it reported earnings on Jan. 24.

So what's up?

The stock is quite expensive for market-matching growth

Some of Microsoft's problems may be short lived. Weaker consumers caused the poor PC market, plus many have already upgraded their devices recently thanks to the COVID pandemic.

This thought is reflected in analyst projections for Microsoft, as they expect revenue to only grow at a 5.4% pace in FY 2023 (ending June 30) but an 11% clip in FY 2024. Earnings follow this same pattern as well.

Fiscal Year EPS YOY Growth
2022 $9.65 20%
2023 $9.36 (3%)
2024 $10.75 15%

Data source: Microsoft and Yahoo! Finance.

So, FY 2023 will be a bit of a breather for Microsoft, but 2024 will pick right back up where 2022 left off. So even with that outlook, is the stock still too expensive?

Besides a year when its earnings were inflated and skewed its historical price-to-earnings (P/E) ratio, Microsoft has traded in the mid-to-high 20s valuation range.

MSFT PE Ratio Chart

MSFT PE Ratio data by YCharts

But that was also when Microsoft was posting consistent 15% revenue growth. The analysts' outlook isn't that strong anymore, so Microsoft will likely trade at a slightly lower premium.

With the stock trading at 27 times 2024 earnings, it's quite expensive for the 11% growth expected in FY 2024. This means I think it's wise to steer clear of Microsoft's stock now, especially with what I would call an unwarranted 20% run-up since it reported earnings.

Microsoft's performance will likely be market matching, which makes sense for how large it has gotten. If I want market matching, I'll just buy an index. There are too many stocks with market-crushing potential, and I'd rather focus on them.