Last year was a difficult one for stock market investors, to say the least. Not only did the riskiest and most speculative companies see their share prices plummet, but even the most dominant, successful, and competitively advantaged enterprises experienced falling stock prices. Tightening monetary policy and a general risk aversion by investors negatively affected businesses of all shapes and sizes. 

Even Costco Wholesale (COST 1.00%) wasn't immune from the despair. This top retail stock ended 2022 down 20%. Does that mean it's a smart buy right now? Let's take a closer look. 

Costco is facing a slowdown 

As consumers flocked to its popular warehouses during the depths of the pandemic, Costco flourished. Sales jumped 17.5% in fiscal 2021 and 15.8% in fiscal 2022 (ended Aug. 28), exceeding historical averages. In fact, year-over-year revenue growth was above 12% in nine straight quarters from the fourth quarter of 2020 through Q4 2022.  

But thanks to the softening macro environment, as well as a difficult prior-year comparison, Costco's net revenue increased just 8.1% in the fiscal 2023 first quarter (ended Nov. 20). Same-store sales were up just 6.6% for the 12-week period. December's figures were even lower, with net revenue and same-store sales rising by 7.6% and 5.5%, respectively, year over year. 

To be fair, these are healthy growth rates in the grand scheme of things, and they are still in line with Costco's historical numbers. Moreover, shareholders couldn't have reasonably expected the company's pandemic-fueled growth to last indefinitely. What is really promising, though, is the fact that customer foot traffic was up 3.9% worldwide in the most recent fiscal quarter, with the average ticket size up 2.6%. That's definitely an encouraging sign given all the worries about inflation. 

While management doesn't provide detailed guidance, we can look at consensus estimates to gain some clarity. Wall Street analysts think Costco's revenue will rise 7.4% in fiscal 2023, with earnings per share increasing by 10.8%. Should a severe recession end up happening at some point this year, it could throw these projections way off.  

But regardless of what happens, one thing is certain. Costco's memberships, which had a 92.5% renewal rate in the U.S. and Canada in the quarter, will continue to be a major competitive strength for the business. They drive customer loyalty, and they are a high-margin revenue source for Costco. 

Consider the valuation before buying Costco stock

While I have no doubts whatsoever that Costco will be able to handle any possible recessionary scenario in the near term and come out stronger on the other end, I'm not rushing to buy the stock just yet, even when taking into account that it was down 20% last year. 

My hesitation stems from the stock's valuation. As of Jan. 20, Costco shares traded at a price-to-earnings (P/E) ratio of 36. That's more expensive than a direct rival like BJ's Wholesale Club. This premium doesn't bother me. Costco's elevated valuation can certainly be justified thanks to its better growth, higher profitability, and fanatical customer base. These characteristics definitely warrant a high P/E multiple. 

However, when you compare Costco's P/E ratio to its past, it's a different story. Over the past 10 years, the stock's P/E multiple averaged 32. This encapsulates a stretch of time when interest rates were much lower and Costco had bigger opportunities for expansion. Today's valuation, which is higher than the trailing average, is at a time when Costco is slightly more mature, and when interest rates are rising. 

I think Costco is a fantastic business. But its shares are richly valued today. Therefore, the best course of action prospective investors can take is to wait on the sidelines. Continue to monitor sales trends to understand how the company is faring, and keep a close eye on the P/E ratio. If it drops meaningfully, then it might be a good time to buy the stock.