Tech giant Microsoft (MSFT -1.85%) recently closed its fiscal year 2024 with its fourth-quarter earnings report. It's remarkable that the world's second-largest company by market cap, a behemoth with over $200 billion in annual revenue, can still grow as it does. Microsoft's Q4 earnings topped Wall Street's expectations in both revenue and profits, yet the stock sold off somewhat on the news.

Are there signs of trouble buried in the fine print of Microsoft's quarter? This Fool analyzed earnings to find out what went right, what went wrong, and whether the stock is buyable today.

Strength throughout this diversified company

If you forgot how prevalent Microsoft's products are in society, look no further than the recent IT outage, which froze millions of computers worldwide, affecting airlines, banks, and other services. Microsoft touches virtually all areas of worldwide technology today. Its software powers personal and enterprise computer systems. Azure, its cloud platform, is a foundation for the internet. The company also owns leading gaming brands, the networking site LinkedIn, and more.

It's remarkable that Microsoft is so diverse, yet is putting up strong growth across the board. Sales of commercial Office 365 software grew 12% year over year, and personal 365 subscriptions increased to 82.5 million, from 80.8 million three months ago. LinkedIn revenue grew 10% year over year. Azure and other cloud services grew revenue by 29% on artificial intelligence (AI) tailwinds. Even Windows, which has been around since the 1980s, grew sales by 7%. Overall, Microsoft's Q4 revenue grew 15% year over year to $64.7 billion. Earnings per share came in at $2.95, up 10% over last year.

Investors might not fully appreciate how impressive it is that such a large, complex company with many moving parts can generate double-digit growth across almost the entire business.

Microsoft has a good AI problem

If there was a blemish, Azure's 29% growth came up short of the 30% to 31% target that management forecasted the previous quarter. Though the stock hasn't plummeted, the modest sell-off seems to be due to this perceived miss on Azure growth. However, management gave some critical context in the Q4 earnings call.

Specifically, management noted that Azure AI doesn't have enough capacity to fulfill demand. AI alone contributed eight percentage points to Azure's growth. Microsoft's Azure AI customer base grew to over 60,000 in Q4, up 60% from a year ago, and spend per customer is growing. Microsoft spent $19 billion on capital expenditures in Q4, virtually all of it on cloud and AI. Management forecasted higher spending in 2025 to accommodate strong AI demand.

Azure AI likely would have grown more in Q4 if it had the capacity. This is a good problem -- it signals long-term growth opportunities as data center capacity increases.

Is the stock a buy now?

The cloud business is Microsoft's largest and fastest-growing segment, and it should continue driving total growth as AI capacity comes online.

Analysts estimate that Microsoft will grow earnings by an average of 16% annually over the next three to five years. That seems reasonable, given the company's current revenue growth. Capital investments should also moderate over time, and those dollars should flow back to earnings.

Overall, Microsoft's growth prospects look great. However, shares still trade at a price-to-earnings (P/E) ratio of 35 times the company's 2024 earnings. The resulting price/earnings-to-growth (PEG) ratio of 2.2 is steep, even for a company growing earnings like Microsoft. The market has been willing to pay for the stock: Microsoft's average P/E ratio is 32 over the past five years.

MSFT PE Ratio Chart

MSFT PE Ratio data by YCharts.

It seems that Microsoft is probably a little overvalued today, and that could help explain why the market sold the stock on the slightest imperfection in its earnings report. Investors shouldn't rush to buy Microsoft. The stock market will inevitably stumble, and investors may get a better buying opportunity on high-flying stocks like Microsoft.

Patience could pay off in Microsoft's case.