Microsoft (MSFT -2.45%) is one of the largest enterprises in the world with a market cap of $1.8 trillion. Its operations span from office productivity and collaboration tools to cloud computing and gaming services.

Over the past three years, Microsoft stock has outperformed the broad market, jumping over 160% compared to the 52% gain of the S&P 500. But past success is no guarantee of future performance, so is Microsoft still a buy?

Productivity software

Microsoft is the clear market leader in office productivity software. Applications like Word, PowerPoint, and Excel are industry standards, and collaboration tools like Teams and SharePoint make it possible to work together from anywhere.

Satya Nadella standing on a stage giving a presentation

Image source: Microsoft.

Not surprisingly, the pandemic sparked strong demand for many of these products. For instance, Microsoft Whiteboard in Teams -- a feature that allows remote collaboration -- has seen a 12-fold increase in monthly active users over the past year. And while Teams is a free product, it adds substantial value to Microsoft 365, the company's software-as-a-service offering.

In the first half of fiscal 2021 (the six months ended Dec. 31, 2020), sales in Microsoft's productivity segment jumped 12%, driven by 21% growth in Office 365 commercial revenue. Also noteworthy, Dynamics 365 sales -- a hybrid of enterprise resource planning (ERP) and customer relationship management (CRM) software -- jumped 38% during the same period.

Cloud computing and gaming

Microsoft Azure is the second most popular public cloud in the world, and it's gaining ground on Amazon Web Services (AWS). At the end of 2020, Azure had achieved 20% market share, up from 15% at the end of 2018. Meanwhile, AWS has dropped from 33% to 32% over that period.

To avoid vendor lock-in, more cloud computing customers are opting for hybrid or multi-cloud solutions -- meaning cloud resources are split between on-premise data centers and one or more public clouds. Microsoft has leaned into this trend and established itself as a leader.

Azure Arc enables clients to extend Azure management to any environment. Put another way, users can manage all cloud resources from one location, even if those resources aren't stored in Microsoft's cloud. That greatly reduces complexity, and it makes a strong case for why clients should choose Azure as part of their cloud strategy.

Xbox Series X and S.

Image source: Microsoft.

In gaming, Microsoft launched the Xbox series X and S last November -- the series X was designed for performance while the series S comes at a more affordable price. In a recent earnings call, CEO Satya Nadella called it "the most successful" launch in the company's history "with the most devices ever sold in a launch month." That helped drive gaming revenue of $2.3 billion in the first six months of fiscal 2021, up 38% from the prior year.

The big picture

Microsoft has delivered an impressive financial performance in recent years, driven primarily by strength in its productivity and cloud computing businesses.

Both revenue and free cash flow have logged double-digit compound annual growth rates, and investors should note the company's gross margin has trended upward as well, rising from 65% in 2017 to 68% in the trailing 12-month period. That improving profitability has actually helped free cash flow grow more quickly than revenue.

Also noteworthy, Microsoft currently has $132 billion in cash, equivalents, and short-term investments on its balance sheet. That's more than double its $60 billion of debt, putting the company in a very healthy financial position.

In terms of valuation, Microsoft trades at 12 times sales and 36 times earnings. Both of those figures are at the high end of their historical ranges. In other words, the stock looks more pricey today than it has for most of the last decade.

The verdict

Investors should keep in mind that while Microsoft's vast operations come with an enormous market opportunity, the company faces competition from virtually every angle. Most notably, in cloud computing, the tech giant squares off with AWS and Alphabet's Google Cloud. And in the market for collaboration and CRM software, Microsoft competes with salesforce.com, a rivalry that could become more intense if Salesforce's acquisition of Slack wins approval.

However, Microsoft is a very profitable business with deep pockets and a strong competitive position in several industries. From that perspective, this stock looks like a good addition to any portfolio, even at today's elevated valuation.