Microsoft (MSFT 1.07%) investors underperformed the S&P 500 in 2022 but are looking at market-thumping returns over the last several years. The software giant's stock is up over 40% since early 2020 compared to a 20% increase in the broader market.

It is those multiyear returns that really matter to an investor's portfolio, even though gains can be rocky from one quarter to the next. With that broader picture in mind, let's look at the prospects for this business by early 2026.

Cloud services

One of the best reasons for liking Microsoft stock is its diversity of revenue streams. The software giant has a dominant position in PC productivity software but also in gaming, cybersecurity, digital communications, and enterprise cloud services.

Investors don't need to know precisely which of these niches will be much bigger over the next several years. Its cybersecurity and cloud services divisions should be particularly strong.

But rather than relying on a specific segment, Microsoft will likely be posting new sales records in a few years thanks to the combination of several units. Its Azure segment grew 26% in the most recent quarter to help fully offset a 15% drop in the Windows segment, for example. Look for similarly strong broad results over the next several years.

Cash returns and profits

It also seems likely that Microsoft will be sending lots of cash to its shareholders in 2026 and in every fiscal year along the way. The company recently raised its dividend by 10%, demonstrating management's commitment to a steadily rising payout. CEO Satya Nadella and his team spent roughly $10 billion on buybacks and dividends in the fiscal first quarter alone.

MSFT Free Cash Flow Chart.

MSFT Free Cash Flow data by YCharts.

But operating cash flow was a blazing $23 billion this past quarter, which provides management with all the flexibility they need to invest in growth projects while still sending shareholders excess funds. Microsoft generated $73 billion of net income in fiscal 2022 and will likely add significantly to that annual haul over the long term, even if an economic slump threatens results in 2023.

Compelling value

The stock's returns over the next few years will depend a lot on shifting investors' attitudes. Wall Street was highly optimistic about Microsoft's business in late 2021, valuing the stock at nearly 15 times annual sales. That valuation dropped to a near three-year low by early 2023 of less than 9 times sales. A slowdown in enterprise and consumer spending would be a feature of any recession that develops over the next several quarters. There's no guarantee that a shift like that won't further pressure Microsoft's valuation.

On the other hand, the tech giant delivers most of the ingredients that growth stock investors love to see in a business. Among these are a dominant market position, gushing cash flow, and market-leading profitability. Focusing on these metrics will help steady your portfolio during what's likely to be elevated volatility in 2023 and beyond.

There's a decent chance that this volatility will lead to another year of subpar returns for Microsoft's stock. However, its long-term outlook is bright. Investors who simply held the stock will likely look back in a few years and be happy they had this tech giant in their portfolio.