It turns out that raging inflation, closely followed by the Federal Reserve going on the warpath by rapidly raising rates in 2022, was terrible for both consumer confidence and Amazon's (AMZN 1.80%) retail business. At the same time, the Amazon Web Services (AWS) segment didn't fare much better, as companies expecting a downturn in the economy cut back on AWS cloud services to conserve cash in 2022. As a result of its primary two growth engines -- retail and AWS -- producing lackluster results, the company's consolidated fundamentals significantly deteriorated, and the stock dropped 50% last year.

Recently, some economic experts promoted the idea that the U.S. economy could achieve a "soft landing" in 2023 and avoid a recession. If that's true, Amazon's business fundamentals and stock price could sharply rebound over the next several quarters. But considering that other economists think the U.S. economy remains in poor shape and will continue to decline into a recession in 2023, should you buy the stock?

Let's investigate.

Investors have become disenchanted with Amazon

Many investors loved Amazon's U.S. retail business when it produced an operating income, but it's only had operating losses from the fourth quarter of 2021 onward. Thus, this segment has become an anchor weighing down the business:

A bar chart shows North America segment results from Q4 2021 through Q4 2022.

Image source: Amazon Q4 2022 investor presentation. MM = figures in millions; Y/Y = year over year; F/X = foreign exchange; TTM = trailing-12-month.

A good portion of its trouble producing profits in the U.S. retail segment comes from the costs Amazon generated by doubling its e-commerce logistics network -- a reaction to the extraordinary demand from consumers stampeding online to shop during the pandemic. However, in hindsight, it built too many warehouses and infrastructure for slowing consumer demand, resulting in high operating costs for the number of sales produced. Consequently, the company will continue to have profitability issues in retail until management can address that situation.

Next, AWS only provides 16% of the company's sales but most of its operating profits. So, while Wall Street might have partially forgiven the company for the e-commerce segment producing losses if AWS had been firing on all cylinders, that's not the case:

A bar chart shows AWS segment results from Q4 2021 through Q4 2022.

Image source: Amazon Q4 2022 investor presentation. MM = figures in millions; Y/Y = year over year; F/X = foreign exchange; TTM = trailing-12-month.

Growth in the cloud service's net sales decelerated from 40% year over year in the fourth quarter of 2021 to 20% in the fourth quarter of 2022, and management reported that sales growth dropped to the mid-teens in January 2023. Also, operating income fell 2% from last year's comparable quarter, which was disappointing.

Amazon states on its Form 10-K that its financial focus is on long-term, sustainable growth in free cash flow (FCF). Yet with both of its primary growth engines down for the count, it's now producing negative FCF.

AMZN Free Cash Flow Chart

AMZN Free Cash Flow data by YCharts.

However, everything is not all gloom and doom if you have a longer time horizon than a few quarters.

Why long-term investors should consider buying

First, while cloud growth might be down in the short term due to companies tightening their belts in bad economic times, the industry's long-term future remains bright. According to Gartner, global end-user spending on the public cloud will accelerate in 2023. The research company predicts growth of 20.7% in global cloud spending this year, up from approximately 18.8% in 2022.

If you believe Amazon's CEO Andy Jassy, 90% to 95% of global IT spending remains on-premises. And he believes that over the next 10 to 15 years, most IT spending will flip and move into the cloud. So, while no one can predict when economic growth will return -- and things look bleak today, according to management -- the cloud segment's new-customer pipeline remains full of customers planning to migrate to the cloud and commit to AWS over the long term.

Once Amazon's prime profit engine, AWS, reaccelerates sales, operating income, and FCF growth, the stock should strongly rebound.

Next, while Wall Street pays more attention to AWS because it's faster-growing and more profitable, Amazon's U.S. retail business is nothing to sneeze at. As a reminder, the company ran a thriving U.S. retail operation before its fundamentals rapidly receded due to the poor economy; its North American retail segment comprised 29% of its operating income in 2021, and many consider it the most dominant force in retailing.

Amazon is due to become the largest retailer in the U.S. by 2024, according to a 2022 report by digital-commerce consulting company Edge by Ascential. And according to Statista, Amazon is already the leading U.S. e-commerce website, with 37.8% of the market; Walmart is a distant second, with a paltry 6.3% market share. Once the economy normalizes and Amazon improves its cost structure, expect its e-commerce profits to rebound with a vengeance.

The market values Amazon at a price-to-sales (P/S) ratio of 1.9, below its median P/S ratio of 3 over the last ten years -- so it's clearly undervalued.

Since no one can accurately predict when the economy will rebound, it doesn't pay to try and time the market. If you can be patient and think long-term, Amazon is an excellent investment at the current valuation.