Market downturns can be gut-wrenching for traders, but at the same time, they bring a once-in-a-decade opportunity for investors to buy dirt-cheap stocks that can boost their portfolio's returns over the long term. 

Here's why Macy's (M -1.36%) and Wayfair (W -1.91%) could be great bets heading into the new year.

Macy's is focused on growth

Macy's stock price is up roughly 371% since early April 2020, shortly after the pandemic lockdowns first started to ease. The company's recent sales growth continues to point toward a bright future for the iconic department store, and investors can still buy shares at a valuation level that offers more upside. That 371% rise is despite a 13% drop so far in 2022.

In 2020, Macy's unveiled its Polaris strategy, which was designed to cut up to $1.5 billion in costs per year by the end of 2022. Over the last few years, management has invested in improving the e-commerce business, updating stores, and simplifying the merchandise assortment and inventory pricing to attract new customers. It has worked like a charm.

While inflation and other headwinds made 2022 a challenging year for retailers, Macy's has performed well, with company-owned comparable-store sales up 2.3% year to date. The economy is out of management's control, but the positive growth looks strong for a department store that many investors thought was dead before the pandemic.

During the third-quarter earnings call, management said the business is stronger, more agile, and financially healthier than before COVID-19 hit. Most importantly, executives believe they are positioned to deliver profitable growth over the long term. 

The lifeblood of any business is cash, and Macy's free cash flow has significantly improved over the last few years, reaching $1.1 billion over the last year. With a market cap of $6.4 billion, Macy's stock trades at just 6 times free cash flow, which is a bargain for a retailer that is on offense. 

Wayfair is turning the corner

Leading e-commerce stores experienced a long hangover of sluggish sales performance after the pandemic-driven boom. Wayfair stock took a steep fall from its highs, but this top home goods seller is starting to show the early signs of turning things around heading into 2023. 

While revenue still fell 9% year over year in Q3, it was a lower rate of decline than the previous quarter. What's more, quarter-to-date revenue through October was trending down in the low-single-digit range, which shows sales are getting closer to returning to growth. 

Another indicator that Wayfair is poised to have a better outing in 2023 is positive customer feedback. While Wayfair reported declines in active customers in recent quarters, the company also said its net promoter score increased in Q2, which indicates that Wayfair is still earning customers' trust based on its wide selection and value position in the marketplace. 

WMT PS Ratio Chart

Data by YCharts

The stock is dirt cheap, trading at a price-to-sales ratio of 0.34, while other discount retailers like Walmart trades at 0.69 and e-commerce leader Amazon trades at a multiple of 1.89 times sales. 

Wayfair is facing a massive growth opportunity in a very fragmented industry that is currently valued at $800 billion. With this much runway for growth, investors could see enormous gains off these lows. In fact, this might be the last chance investors have to buy the stock this cheap.