Costco Wholesale (COST 1.01%) has been a great stock for shareholders, delivering a market-beating return of 150% over the past five years -- and the giant retailer is still winning fans on Wall Street following its latest earnings results in May.

Goldman Sachs and a few other top Wall Street companies have maintained buy ratings on the shares. Most analysts are bullish, with a price target as high as $635. Goldman sees the stock trading up to $545 in the short term.

Costco is seeing growing customer traffic and memberships, but the level of sales growth doesn't seem to justify a 20-year-high valuation. Let's take a closer look.

Costco has gotten expensive on a P/E basis

Costco ended the fiscal third quarter with 69.1 million paying household members and 124.7 million cardholders, both up approximately 7% year over year. The stock itself hit a high of $612 in 2022 and has been stuck in a trading range ever since. It has historically traded at a premium price-to-earnings (P/E) ratio relative to the market average. It's common for companies with a loyal customer base and consistent sales volumes to command a high valuation.

But it's also worth noting that over the past few decades, the stock has typically traded at a P/E ranging from the low 20s to around 30. However, the multiple has stretched to as high as 45 in the past few years and currently sits at a still-rich multiple of 38. 

COST PE Ratio Chart

COST PE Ratio data by YCharts

Why the market is paying up

The high premium that investors are willing to pay for Costco's future earnings growth is understandable. With inflation and rising interest rates pressuring consumer spending and weighing on the stock market, Costco is viewed as a safe haven.

Not only did the number of household members grow last quarter, but renewal rates also reached 92.6% in the U.S. and Canada, an all-time high. People are clearly flocking to Costco's stores to save money on groceries and even apparel. Management reported that traffic and shopping frequency remained healthy last quarter, up 4.8% worldwide and 3.5% in the United States.  

Why investors should wait for better prices

The last time Costco's P/E was this high, the stock returned just under 30% total over the following 10 years, from 1999 through 2009. Even though the company doubled its earnings per share (EPS) over that period, the P/E multiple contracted 38%, which weighed on the stock's performance.

COST Chart

COST data by YCharts

Normally, investors buy high-P/E stocks for high growth, but Costco is struggling to sustain the double-digit annual sales and earnings increases it reported during the pandemic.

The company reported a comparable-store-sales (comps) increase of just 0.3% in the recent quarter, or 3.5% excluding gasoline sales and foreign exchange. That's a steep drop from 14.9% in the year-ago quarter. It's also down from adjusted comps growth of 6.8% in the previous quarter. 

While traffic trends are healthy, management cited weakness in big-ticket items, such as electronics, for the slower sales growth. Members are also spending less per visit. 

Costco can grow a little faster in a lower-inflation environment. It regularly reported mid-single-digit sales increases through 2019. But it's unclear whether it can sustain the high growth it experienced a few years ago during the pandemic. So far, it hasn't. 

The retailing behemoth has an excellent business that's worth a spot in anyone's retirement account, but I would wait for a better price. There are more attractive values available in the market right now.