When the stock market enters bear territory, as it has in 2022, nearly every stock takes a hit, because the market tends to overcorrect. Many investors panic when the market slumps, but this is the best time for long-term investors to identify undervalued companies that could provide juicy long-term returns. We just have to know where to look.

Amazon (AMZN 0.00%) long been a stock market darling, but in the past year, it has become more of a pariah after falling more almost 40% from its all-time high. What caused such a massive shift? Well, recent headwinds include:

  1. A shortage of willing and available workers as a result of the pandemic.
  2. Logistical headaches like clogged ports and rising fuel prices.
  3. Inflation crimping margins and threatening to hurt consumer spending.

Two of the company's three segments have swung to operating losses, and it has spent billions addressing these issues.

That doesn't sound good, but before you stop reading, consider these bright spots:

  1. Amazon Web Services (AWS) is firing on all cylinders and highly profitable.
  2. The NFL's Thursday Night Football debut on Prime Video drew 13.0 million viewers, compared to just 8.8 million for a similar game broadcast on NFL Network last year.
  3. The company controlled 50% of the U.S. e-commerce market in 2021.

If you can agree the headwinds are only temporary and Amazon still has a promising future, the question is whether the stock is now undervalued. A "sum-of-the-parts" evaluation offers clues.

What is a sum-of-the-parts evaluation?

Using a sum-of-the-parts evaluation, we break the company down by division or product line and attempt to value them individually. If the sum of these parts is much greater than the company's actual valuation, this could indicate a terrific investing opportunity. This exercise is helpful for a company like Amazon, which operates in several different areas.

Valuing Amazon's components

AWS is hugely profitable and growing fast, making it far and away the most valuable portion of Amazon. Revenue in that segment was up 35% through the first half of this year. Assuming that pace holds for full-year 2022 before slowing to 30% next year, AWS would see $109 billion of annual sales in 2023.

Chart showing Amazon Web Services revenue.

Data source: Amazon. Chart and estimates by author.

A terrific comparison to AWS is Microsoft. Both operate as software-as-a-service (SaaS), turn large operating profits, and are fierce competitors in the cloud market. Microsoft has a forward price-to-sales (P/S) ratio of 8.0 as of this writing. Applying this multiple to AWS would value the segment at $872 billion based on its 2023 guidance. AWS is growing faster than Microsoft, so it might garner an even higher P/S valuation on the open market. A forward P/S ratio of 10 would value the segment at $1.09 trillion.

Amazon has a total market cap of $1.17 trillion now, so investors can purchase the non-AWS part of the company for just $81 billion to $299 billion based on my estimates above. These non-AWS businesses include Amazon Prime, digital advertising, physical stores, and the massive online retail business. These operations accounted for $408 billion in sales in 2021 alone and $21 billion in combined operating profits from 2019 to 2021.

The non-AWS operation has turned unprofitable in 2022, and the stock's current valuation carries with it tons of negativity. But investors who are confident AWS has a long runway and the rest of the company will recover should consider picking up shares during this market downturn. The headwinds Amazon faces won't last forever, and neither will this bear market. It's unlikely this stock will still trade in the bargain bin once they subside.