Shares of discount retail chain Dollar Tree (DLTR 0.04%) got hammered on Wednesday after the company reported a whopping $1.7 billion net loss in its most recent quarter. As of 9:45 a.m. ET, Dollar Tree stock was down 13%.

It's time to update Dollar Tree's footprint

In the fourth quarter of 2023, Dollar Tree generated net sales of $8.6 billion, which were up 12% year over year and right on schedule. However, the company swung to its massive aforementioned loss because it recognizes that it has too many underperforming locations.

Dollar Tree previously announced that it was reviewing its portfolio of stores. But with Q4 results, the company announced that it's closing 600 locations of its Family Dollar chain in the first half of 2024. Thereafter it will close another 370 Family Dollar locations as their leases expire. For perspective, Dollar Tree owned almost 8,400 Family Dollar locations as of Feb. 3.

Between goodwill impairment charges and intangible asset impairment charges, Dollar Tree took a $2 billion hit. Moreover, the review itself cost nearly $600 million, adding to its massive net loss for the quarter.

The silver lining

There's good news for Dollar Tree shareholders in all of this. First, closing underperforming stores can be a good thing. Second, most of the hit that it took during the quarter was noncash losses. From a cash-flow perspective, the company had $2.7 billion from operating activities in fiscal 2023, which was up 66% from its fiscal 2022.

Looking ahead, Dollar Tree expects $31 billion to $32 billion in net sales in its fiscal 2024 -- up slightly from fiscal 2023 despite the planned store closures. And it expects diluted earnings per share (EPS) of $6.70 to $7.30 -- comparable to its diluted EPS in its fiscal 2022.

Therefore, things aren't as dire for Dollar Tree as the market would make it seem today. The company is making some necessary changes that impact the numbers from an accounting perspective. But the business is still fundamentally sound and the stock is a better value now after the drop.