Microsoft (MSFT -1.27%) has featured in countless headlines this year, becoming a major player in artificial intelligence (AI) with a significant investment in ChatGPT developer OpenAI and completing a record deal to purchase Activision Blizzard in October.

Most recently, the company and its investors were jolted by the ousting of OpenAI CEO Sam Altman, sending Microsoft's shares tumbling and bringing its AI prospects into question as it owns a 49% stake in the start-up.

Altman has since been reinstated, and OpenAI's board reconstituted to prioritize Microsoft's interests, seemingly calming investor concern.

The situation brought to light Microsoft's leverage over OpenAI. Microsoft's cloud division Azure owns and houses the supercomputer that OpenAI uses to train its AI models. When Microsoft temporarily hired Altman after his ousting, it had everything it needed to resume business as usual and essentially develop similar tech to OpenAI.

Despite recent uncertainty, Microsoft has solid prospects in AI and is home to a diversified business that makes it less vulnerable to economic fluctuation than other tech companies. Here's why Microsoft stock is absolutely a buy right now.

Microsoft is home to a thoroughly diverse business

Microsoft has become a behemoth in tech, boasting a spot in the world's top two most valuable companies by market cap (second only to Apple).

The tech giant has won over consumers and businesses globally with potent brands such as Windows, Office, Azure, LinkedIn, and Xbox. The success of these platforms has granted Microsoft lucrative positions in cloud computing, productivity software, video games, and social media. Meanwhile, the company has amassed substantial financial resources to invest heavily in its business and expand into new sectors.

Moreover, while some tech companies like Apple have prioritized the consumer market, Microsoft's business is better balanced between consumers and the commercial sector. The company serves the public through its various productivity platforms, Surface computers, and Xbox brand. However, it is also increasingly prioritizing business-to-business operations with Azure and products like Microsoft 365.

MSFT Revenue (Quarterly) Chart

Data by YCharts.

The diversification throughout Microsoft's business makes it far less vulnerable to macroeconomic headwinds than some competitors. The chart above shows Microsoft delivered significantly more quarterly revenue growth in 2023 than many of its peers despite poor market conditions.

In its first quarter of 2024 (which ended September 2023), Microsoft posted revenue growth of 13% year over year as it beat analysts' expectations by close to $2 billion. The company profited from a 13% revenue boost in its productivity segment and a 19% jump in cloud sales.

Microsoft is expanding rapidly in multiple areas of its business and tech, with its stock worth considering before it's too late.

Cheaper than most AI stocks

The AI market has exploded this year and is projected to continue developing at a compound annual growth rate of 37% through 2030. Microsoft was an early investor in the industry, sinking $1 billion in OpenAI in 2019. The company has since added another $12 billion to that investment, allowing it access to some of the start-up's most advanced technology.

Over the last year, Microsoft integrated OpenAI's tech across its software lineup and began monetizing its AI offerings. The tech giant has introduced AI assistants to many of its productivity platforms that Microsoft 365 members can add for $30 on top of the cost of a subscription.

The popularity and extensive user base of Microsoft's services give it massive potential in AI, making its stock an attractive option for anyone interested in investing in the high-growth sector.

AMZN PE Ratio (Forward) Chart

Data by YCharts.

Additionally, Microsoft is one of the cheaper options for investing in AI. The charts above compare the forward price-to-earnings ratios (P/E) and price-to-free cash flows, two helpful valuation metrics, of some of the biggest names in AI right now. Microsoft's P/E and price-to-free cash flow aren't major bargains, but they are far lower than all of these companies except Alphabet.

Microsoft's lower metrics indicate its shares offer far more value than Amazon, AMD, or Nvidia. And the company arguably has similar, if not more, earnings potential from the market over the long term. Along with a diversified business model and consistent revenue gains, Microsoft has earned its slightly high valuation and remains a buy.