Shares of Dollar Tree (DLTR 2.63%) are down more than 5% this year after a recent earnings release led to a sell-off that wiped out its gains up until that point. Investors are worried about what lies ahead for the business as things haven't gone as well as Dollar Tree was expecting.

But here's why, despite current headwinds, it might still be a good stock to buy right now.

The bad news: missed expectations and a slashed forecast

Dollar Tree reported its first-quarter numbers on May 25, which underwhelmed investors. Sales of $7.32 billion for the period ended April 29 came in ahead of analyst estimates of $7.28 billion. On the bottom line, however, adjusted earnings per share (EPS) of $1.47 landed a few cents short of the $1.52 per-share profit that Wall Street was expecting.

That wasn't the only bad news for investors as the company also announced that its earnings for the year will fall between $5.73 and $6.13 per share, down from a previous estimate of $6.30 to $6.80.

The good news: The numbers weren't all that bad

When looking at the past five years, Dollar Tree's revenue growth rate has averaged around 5% -- and it's doing better than that right now, suggesting that the retailer is by no means struggling.

DLTR Revenue (Quarterly YoY Growth) Chart

DLTR Revenue (Quarterly YoY Growth) data by YCharts

Same-store sales at its Dollar Tree stores were also up 3.4% last quarter, and at Family Dollar, they grew by 6.6%. Those are some decent growth rates on top of already strong numbers from a year ago, when the economy was in better shape.

One of the challenges Dollar Tree and other retailers are facing right now, however, is higher levels of shrinkage (i.e., theft) as consumers struggle with rising prices, which is eating into profitability. But the company did hint that things could get better toward the end of the year as it benefits from lower freight rates.

And so while at first glance an earnings miss and lower guidance may be concerning, it doesn't mean the business is in trouble. If it can keep up the strong growth rate and its costs come down, Dollar Tree may be in good shape to post some stronger results in the near future. For long-term investors, Dollar Tree's stock can still make for a good buy, especially now that it's trading at a reduced valuation.

The stock provides good value right now

Currently, shares of Dollar Tree are trading at 23 times trailing earnings. Prior to the pandemic -- from 2015 through 2019 -- the company was averaging an earnings multiple of 28.

Given the current economic conditions, investors aren't as willing to pay as big of a premium for stocks as they did in the past. However, as a bull market emerges and if Dollar Tree's financials can improve toward the tail end of this year, as management expects, there could be multiple catalysts that could soon give the stock a boost and potentially get it back to a higher valuation.

It could be an underrated buy right now

Trading just a few dollars away from its 52-week low, Dollar Tree's stock can make for a good investment to hang on to today. The business is still growing, and with reason to be optimistic about its future, this is a retail stock that investors could become more bullish about as the year goes on.