Once the pinnacle growth stock to own, Amazon (AMZN -1.64%) has had a rough 2022 and is down 38% year to date. While some of this fall was self-inflicted, another portion came from sentiment change.

With a disappointing 2022, next year could see a rebound for the e-commerce company. But will it be enough to beat the market?

Amazon's track record is impressive

First, let's see how Amazon has done against the market over the past decade.

Year Amazon Return (Decline) S&P 500 Return Amazon Win?
2012 45% 13% Yes
2013 59% 30% Yes
2014 (22%) 11% No
2015 118% (1%) Yes
2016 11% 10% Yes
2017 56% 19% Yes
2018 28% (6%) Yes
2019 23% 29% No
2020 76% 16% Yes
2021 2% 27% No
2022 to date (43%) (16%) No

Data source: 1Stock1 and Macrotrends.

Beating the market for seven years and losing for four is a solid track record. This is why Amazon is trouncing the market over that period.

AMZN Total Return Level Chart

AMZN total return level; data by YCharts.

But 2022 has been ugly for Amazon. One of the key causes of skepticism was its loss of profitability. Amazon has burned $26 billion in cash over the past 12 months after producing $26 billion in 2020.

Certainly, 2020 was a boost for Amazon's commerce business, and when the company adjusted to the demand, it overhired. Now the company is correcting that, recently announcing plans to lay off about 10,000 workers (about 3% of its workforce).

This is just one step on the road back to profitability for Amazon, but clawing its way out of a $26 billion hole won't be easy.

If Amazon makes significant strides toward positive free cash flow in 2023, the stock will likely move higher because it doesn't have a lot of room to move down.

The stock is cheaply valued

With the stock trading at 1.9 times sales, it has reached the same level as it last did in 2015. Since then, Amazon's market share in retail and cloud computing has impressively exploded.

Over the past 12 months, its commerce division has racked up $425.7 billion in sales, while the cloud computing division brought in $76.5 billion. If you value each business segment individually, it's easy to determine that Amazon's stock is undervalued.

Walmart and Target both trade at 0.7 times sales, and Microsoft trades at 9.1 times sales. If you apply the retailers' valuation to Amazon's commerce business and Microsoft's tech valuation to the cloud computing segment, you will get a calculated valuation of $994 billion. Compared to Amazon's current market cap of $953 billion, it shows the stock is undervalued.

I think those applied valuations are low, as its commerce segment (20% growth in North America) and AWS (27% growth) are rising much quicker than Walmart, Target, and Microsoft. However, with Amazon's profitability problem, it might also deserve the discount.

With revenue growing at a healthy rate (up 15% in the third quarter), an undervalued stock, and management taking steps to regain profitability, I'm excited about the stock's future. Next year is setting up for a strong rebound for Amazon, which makes me confident that the stock will beat the market.

Regardless of 2023, I still think Amazon is primed to beat the stock market over the long haul, so I'm a confident investor in the stock next year and beyond.