Shares of Microsoft (MSFT 0.37%) have risen about 36% from their 52-week low and more than 50% since the beginning of 2013, giving investors in the company a solid gain. With Microsoft at levels not seen since the dot-com boom, however, the company's stock is no longer the obvious value that it was last year. It is still attractively priced, although it's important to understand the risks facing the company.

MSFT Chart

MSFT data by YCharts

The biggest threats facing Microsoft
Microsoft's business is intimately connected to the PC, and the weak PC market of the past few years hasn't been good for many PC-centric companies. Microsoft has managed to continue to grow revenue and prevented profitability from declining by too much, but there is pressure on Microsoft's two most important products: Windows and Office.

Microsoft has long benefited from the PC being the dominant computing device, as Windows runs on more than 90% of PCs. However, the rise of mobile devices running other operating systems, like Google's (GOOG 0.74%) (GOOGL 0.55%) Android and Apple's (AAPL 1.27%) iOS, has drastically reduced Microsoft's share of total computing devices. The more people there are who use platforms other than Windows, the more applications are developed for them. This causes the advantage that Windows once had of being the main target for developers to slowly slip away.

At the same time, Microsoft Windows itself is being attacked on two fronts, from Google's Chromebooks on the low end and from Apple's Macs on the high end. Chromebooks run Google's Chrome OS, a web-centric operating system that, while far more limited than Windows, offers enough functionality for some people while being priced as low as $200. Apple's Macs have long held a small piece of the PC market, but Apple's market share has been growing recently. The company saw a 28.5% surge in sales during the fourth quarter, propelling Apple to a 13.7% share of the U.S. PC market. There's little doubt that the success of the iPhone and iPad has carried over to the PC market.

Microsoft Office is also under attack, with Google offering its productivity apps to businesses for a lower price than Microsoft. While Google's apps are strictly cloud-based, leaving Microsoft alone in the non-cloud market, Gartner estimates that half of productivity suite users will be using cloud-based services within 10 years. While Microsoft dominates the non-cloud-based market, Google could have a share as high as 50% of the cloud-based market.

While all of these threats sound serious, there are plenty of reasons to believe that Microsoft will be just fine.

Why Microsoft will persevere
While Windows 8 may not be selling all that well, Windows remains the standard PC operating system. It's true that Google's Chromebooks appear to be selling well, routinely being listed atop the best-selling notebook list on Amazon. Chromebooks represented just 1% of the global PC market in 2013, however, and this was mostly on the consumer side. This percentage may be higher if only the U.S. market is considered, but a few million Chromebook sales per year barely makes a dent in Microsoft's market share of the global PC market.

Apple's Macs have long been relegated to a small portion of the PC market, and that's not going to change. Mac prices are far higher than PC prices, and Apple is unlikely to lower prices enough to actually compete on price with Windows PCs. For the same reason that Apple doesn't sell budget iPhones and iPads, Apple won't sell truly budget PCs. While the average selling price for a Mac is well over $1,000, overall the average price of a computer is closer to $700, with Macs acting to raise the average. This price difference is enough to keep Apple from gaining too much market share, and lowering prices to compete would cut into the company's profits, rendering it no better than sellers of commodity PCs.

It's clear that Microsoft is worried about losing its dominance of the productivity software market. The company has been aggressive in pushing Office 365, its cloud-based version of Office, using copious cloud storage space to sweeten the deal for both consumers and businesses. Office 365 has been growing quickly, but as more companies move to cloud-based services, Microsoft needs to ensure that they'll remain Microsoft customers.

While Google is certainly a threat, it's not the first threat that Microsoft has faced. There have been free productivity suites available for years, such as OpenOffice, and Microsoft's market share has been largely unaffected. People have been willing to pay for Microsoft Office even when free alternatives exist. Part of it is familiarity with Office, and part of it is that Office is more fully featured than any of the alternatives. Google's Apps are basic and minimal, and while that appeals to a portion of the market, it can't fully replace Microsoft Office.

Microsoft is still cheap, but not that cheap
Despite these threats, shares of Microsoft are still priced attractively. The huge amount of cash that Microsoft carries on its balance sheet tends to skew the standard P/E ratio. Backing out the $9.62 per share in net cash and investments, Microsoft trades at 12.5 times TTM earnings. This is a far cry from the single-digit ratios of early last year, but a company like Microsoft should be trading at a higher valuation given that the P/E ratio of the S&P 500 is currently in the high-teens. A P/E ratio of 15, again adjusting for net cash, would lead to a share price of around $48, and that leaves a considerable amount of upside available. There's still quite a bit of pessimism baked into Microsoft's share price, and that creates an opportunity for investors.