Big-box retailer Costco Wholesale (COST -2.50%) is one of Wall Street's most remarkable examples of wealth creation. A $10,000 investment in the stock in 1980 would now be worth more than $8 million had you bought, reinvested dividends, and held on over the years.

Today Costco is one of the world's largest companies, so you can't get away with buying and holding at any price and expect the same results. And investors fleeing to dependable, high-quality businesses have bid Costco stock up to a lofty valuation.

The company's most recent sales data signals that consumers might feel financially strapped. Here is how investors should handle the situation.

Is the consumer cooling off?

The pandemic stimulus played a significant role in boosting Costco's revenue growth. But you can see below that growth has slowed since peaking in the summer two years ago, even as high inflation over the past 18 months has supported growth (sales data isn't inflation-adjusted).

COST Revenue (Quarterly YoY Growth) Chart

COST Revenue (Quarterly YoY Growth) data by YCharts

The most recent data shows that trend continuing. Costco's March sales data indicated that total company sales in March were down 1.1% year-over-year, and e-commerce was down 12.7%. Why? The most likely answer is rampant inflation has continually driven up living costs for most consumers, who are scrutinizing their spending more closely.

That's not to say that Costco's business will implode in a recession -- consumers go to Costco for gas, groceries, and other needs. Instead, the company is transitioning from an abnormally friendly operating environment. The COVID-19 stimulus program did precisely what it intended -- boost consumer spending -- and that money would always run out eventually. Costco should be just fine over the long term.

What does that mean for the stock?

However, the pullback in consumer spending could impact the stock. Investors have piled into Costco, and even though shares are already down almost 20% from their high, the valuation is still ambitious today.

The stock averaged a price-to-earnings ratio (P/E) between roughly 25 and 30 before the pandemic, and could eventually find its way back to that level if growth continues slowing.

COST PE Ratio Chart

COST PE Ratio data by YCharts

The stock's current valuation at 36 times earnings is about 20% above that historical range, which means investors could see a couple of scenarios play out. Shares could decline until the valuation falls in line, especially if a recession or other event sinks the broader stock market. Or the stock could sort of hover as earnings grow and the valuation catches up.

Consider these options

So what should investors do? Those already holding shares should think twice about selling. Costco is a genuine blue-chip stock that has proven its ability to generate wealth for shareholders and will likely continue over the next decade and beyond. Selling the stock would be like trimming the flowers in your garden.

Investors looking to own the stock have a couple of options: wait until the valuation comes down, which is never guaranteed, even if the data implies it should; or buy shares very slowly, a strategy called dollar-cost averaging.

Buying slowly means buying some shares higher or lower over time, slowly building a position at several different price points. You'll end up with an average cost basis that isn't the lowest, but will prevent you from jumping in with both feet at the wrong time.