It used to be smooth sailing for Ulta Beauty (ULTA -0.58%) shareholders. The retailer, focused on the beauty market, has beaten the market since going public close to 20 years ago. It's now up 1,190% compared to the S&P 500's 381% total return.

Unfortunately, this year has not been so kind. Ulta's stock is down 22% year to date even though the S&P 500 is up 12% and pushing through to all-time highs on the back of the artificial intelligence boom. Investors are worried about slowing growth at the brand's retail locations, and the stock now trades at its cheapest earnings multiple in years.

What happened to Ulta Beauty stock, and is it a buy at this discounted price? Let's look closer and find out.

Ulta Beauty: Specialty beauty at scale

Ulta Beauty is a retailer that caters specifically to the beauty market. This mainly includes women, with a skew toward capturing the younger millennial and Gen Z beauty spenders. It estimates there are 70 million beauty "enthusiasts" who are its target, recurring customers in the United States.

With an omnichannel strategy that includes robust e-commerce sales, Ulta believes it can be the go-to shopping destination for any beauty customer around the country. So far, this has proven true with an astounding 43 million shoppers currently on its Ulta loyalty program.

This focus on a single niche has resonated with many shoppers. Ulta did $11.2 billion in revenue last year, up from $10.2 billion a year prior. Ten years ago, it was only doing $3 billion in annual revenue. With a $112 billion beauty-products market in the United States, the company still has a long runway to steal market share from legacy operators like department stores and mass merchandisers. As long as it keeps up its superior customer offering, I think it can do just that.

Comp sales slow, but that's nothing to be concerned about

If the company keeps growing, why is the stock down? It all comes down to comparable-sales growth, which is a retail metric that measures revenue growth from existing locations a year prior. Last quarter, Ulta reported comp sales of just 2.5%, which was its 11th straight quarter of slowing same-store sales growth. This is a concern among investors because if this trend continues, Ulta will hit negative comparable-sales growth soon, which will hurt its profit margins and earnings per share (EPS).

Shares of Ulta fell sharply after putting out this report, indicating that Wall Street was underwhelmed by these numbers. I believe these analysts may be overreacting and only focused on the next quarter, which long-term investors can take advantage of.

For one, comparable-sales growth is still positive. Second, many retailers are facing comparable-sales growth pressure this year as inflation subsides on consumer goods. The company put up phenomenal comparable-sales growth in 2021 and 2022 in the double digits. Now, it is lapping these periods and putting up weaker numbers with inflation down.

This year, Ulta is guiding for 4% to 5% comparable-sales growth. This will be an important number to track not just this year but over the next few years to see whether Ulta is still gaining market share in the beauty space.

ULTA Shares Outstanding Chart

ULTA Shares Outstanding data by YCharts.

Is the stock cheap today?

Today, the market is worried about a short-term deceleration in Ulta's comparable-sales growth. This has brought the stock's price-to-earnings ratio (P/E) to its lowest level in years. It currently trades at a P/E of 14.5. This seems much too cheap for a company with this level of earnings growth.

Over the last 10 years, Ulta's EPS has grown at a cumulative 644%, driven by new store openings, positive comparable-sales growth, and share repurchases. Shares outstanding are down 25% in the last 10 years for reference.

With still plenty of white space to grow in the United States (not to mention internationally), guidance for positive same-store sales in 2024 and beyond, and a cheap stock to buy back shares, I think Ulta Beauty can continue growing EPS at a high rate for many years into the future. A P/E of 14.5 is too good of an offer to pass up for a company with this history of earnings growth and prospects for future earnings growth.

Now looks like a great time to back up the truck and buy some Ulta Beauty for your portfolio.