Over the past five years, Costco's (COST 0.28%) stock rallied 165% as the S&P 500 advanced less than 50%. The warehouse retailer easily outperformed the market as it consistently opened new stores, gained more paying members, and maintained high renewal rates.

Between fiscal 2017 and fiscal 2022 (which ended last August), its store count grew from 741 to 838 locations, its number of cardholders rose from 90.3 million to 118.9 million, and its global renewal rate climbed from 87% to 90%. During that period, its annual revenue grew at a compound annual growth rate (CAGR) of 12% as its EPS increased at a CAGR of 17%. Those stable growth rates made Costco a favorite evergreen investment for long-term investors. But will its stock continue to reach new highs over the next five years? Let's review its core growth strategies to find out.

A shopper checks a smartphone while pushing a shopping cart.

Image source: Getty Images.

Costco's simple formula for growth

Costco generated 98% of its revenue from product sales and the remaining 2% from its membership fees in fiscal 2022. However, those $4.2 billion in membership fees accounted for most of its $7.8 billion in operating profits.

Those high-margin membership fees enable it to sell its products at lower prices than other brick-and-mortar retailers. They also lock in its customers, widen its moat against similar warehouse retailers like Walmart's Sam's Club and BJ's Wholesale, and insulate it from temporary challenges like COVID-19 and inflation.

Costco sells a lot of its products in bulk, which makes it an attractive option for price-conscious consumers during economic downturns. Selling higher volumes of products at lower prices feeds its economies of scale and enables it to keep expanding its brick-and-mortar footprint as other retailers shutter more stores to cut costs.

The formula for Costco's success is simple: It needs to keep gaining members, maintain high renewal rates, occasionally raise its fees to keep pace with inflation and open new stores. It's repeatedly checked all four boxes over the past five years.

Can Costco continue to check those boxes?

Every five to six years, Costco raises its membership fees to offset inflation and other rising costs. Its last membership fee hike occurred in 2017, so it's widely expected to raise its fees again this year. During its latest conference call, CFO Richard Galanti said it was a matter of "when, not if" Costco raises its membership fees again. So this year investors should see if the macro headwinds impact Costco's ability to raise its fees and if that price hike meaningfully affects its renewal rates.

Another concern is the possibility of a recession. Over the past year, Costco offset its slower consumer spending on pricier products like consumer electronics and appliances with faster sales of food and sundries. It also offset the currency headwinds at its overseas stores with higher gas prices at its fueling stations. But that balancing act could still fail in a deep recession. Looking back at the Great Recession, Costco's comparable sales fell 4% in fiscal 2009 as its net income declined 15%.

Yet analysts don't expect history to repeat itself anytime soon. Instead, they believe that between fiscal 2022 and fiscal 2025, Costco's revenue will continue to grow at a steady CAGR of 7% as its EPS increases at a CAGR of 11%. We should take those estimates with a grain of salt, but Costco's resilience throughout previous economic downturns and its ability to quickly rebound from recessions supports those conservative expectations.

Where will Costco's stock be in five years?

If Costco hits those targets and continues to grow its earnings per share at a modest CAGR of 11% through fiscal 2028, it could generate an EPS of around $24.50 by the final year. If it's still trading at 35 times forward earnings by then, it could be worth nearly $860 a share -- a gain of nearly 70% from its current price.

However, investors should note that Costco has been trading at a premium to its peers because it's considered a safe haven play for the bear market. Walmart and BJ's trade at 22 and 20 times forward earnings, respectively. So if Costco's growth unexpectedly slows down and it loses its premium valuation, its stock could only rise slightly by the end of fiscal 2028.

I believe Costco will land somewhere between those best- and worst-case scenarios. Its core business should keep growing, but its valuations could cool off if a new bull market starts and drives investors toward higher-growth sectors again. It's still a solid long-term investment, but investors should be aware that it isn't cheap relative to its growth rates.