Warren Buffett's Berkshire Hathaway (BRK.A -0.39%) (BRK.B -0.56%) recently disclosed a new position in Ulta Beauty (ULTA -0.91%). According to its latest quarterly filing, Berkshire owns 690,106 shares of the cosmetics retailer, equating to a roughly 1.4% ownership stake. While Berkshire's $250 million investment is modest, considering its stock portfolio is currently valued at over $313 billion, it has been known to add to previous investments over time.

So, let's examine why Berkshire might have purchased Ulta Beauty and whether the stock is worth adding to your portfolio.

Ulta Beauty stock is struggling

Despite its year-over-year revenue growth of 3.5% in the first quarter of its fiscal 2024, ended May 4, investors have shied away from Ulta Beauty in 2024. Shares for the cosmetic retailer are down nearly 24% year to date as management recently lowered its fiscal 2024 guidance, and its margins are shrinking.

Management has revised its fiscal 2024 net sales forecast, lowering it from a range of $11.7 billion to $11.8 billion down to a new estimate of $11.5 billion to $11.6 billion. Additionally, the company anticipates that comparable sales, which it defines as sales from stores open for at least 14 months and e-commerce, will grow by just 2% to 3%, down from the earlier expectation of 3% to 4%. Typically, comparable sales indicate the overall health of a retailer since sales from new stores tend to lag behind established ones.

Meanwhile, both its gross margin and operating margin in the first quarter declined year over year. Gross margin is a key metric for retailers because it demonstrates the ability to raise prices, and if it declines, it may be a sign the company is relying heavily on promotions or customers aren't willing to pay higher prices. Ulta Beauty's gross margin for its most recently reported quarter decreased year over year from 40% to 39.2%.

At the same time, the company's operating margin -- a gauge of a company's profitability measuring revenue retained after the cost of goods sold and operating expenses -- decreased from 16.8% to 14.7%. Management blamed higher selling, general, and administrative expenses, such as higher wages and increased store expenses, for its declining margins.

Moreover, management has revised its full-year operating margin guidance from a range of 14% to 14.3% down to a range of 13.7% to 14%, meaning the metric will likely worsen in the short term.

ULTA PE Ratio Chart

ULTA PE Ratio data by YCharts

Here's why Berkshire invested in Ulta Beauty

Despite the slowing growth and margin decline, there's a lot to like about Ulta Beauty stock. In Buffett's 2019 annual shareholder letter, he wrote:

We constantly seek to buy new businesses that meet three criteria. First, they must earn good returns on the net tangible capital required in their operation. Second, they must be run by able and honest managers. Finally, they must be available at a sensible price.

Using trailing-12-month earnings against net tangible assets, Ulta Beauty earned approximately 73% pre-tax or 55% post-tax of the net tangible equity capital required to run its business. Buffett wrote in the same shareholder letter that Berkshire looks for at least 20%, meaning Ulta exceeds expectations.

While it can be difficult to quantify the honesty of a company's management, Ulta Beauty is led by CEO David Kimbell, who took the helm in 2021. Kimbell has been with Ulta Beauty since 2014 and previously held the positions of chief marketing officer and president. Since Kimbell took his position with Ulta Beauty, its stock has delivered a total return of 310%, outpacing the S&P 500 by nearly 40%.

Finally, turning our attention to Ulta Beauty's valuation, the stock currently trades at 14.6 times trailing-12-month earnings per share, which is near an all-time low. Moreover, Ulta Beauty has a median five-year P/E ratio is 21.2, and so the stock is trading well below that level.

ULTA PE Ratio Chart

ULTA PE Ratio data by YCharts

Is Ulta Beauty stock a buy?

Ulta Beauty is certainly facing its challenges, but the company is still well positioned for growth. Its balance sheet has a net cash position of $525 million, which lends itself to the company's plans to open 48 to 53 net new stores for the remainder of its fiscal 2024, adding to its total of 1,395 stores.

While Ulta Beauty investors wait for a bounceback, the company continues repurchasing shares, boosting shareholders' ownership stake and earnings per share. The company has lowered its share count by 26% over the past decade and has $1.8 billion remaining to deploy under its current share repurchasing program.

Buffett once wrote, "Whether we're talking about socks or stocks, I like buying quality merchandise when it is marked down." Ulta Beauty fits the bill when it comes to buying a proven business at a discount, making its stock a worthy addition to any long-term investor's portfolio.