Sales growth has slowed and profitability trends have deteriorated rapidly at Macy's (NYSE:M) over the past year, following a brief rebound in 2018. That has caused Macy's stock to crash such that it now trades for less than six times earnings.

Management acknowledges that Macy's faces major obstacles to its profitability, mainly rising delivery costs, labor cost inflation, and stiff competition. On the other hand, the company has managed seven consecutive quarters of comparable-store sales growth, which shows that its investments to drive growth are working. Cost pressure has been the main impediment to Macy's goal of getting earnings growing again.

At an investor conference last week, Macy's executives presented their long-awaited cost-cutting plan. Macy's expects to reduce annual costs by $400 million to $550 million within two to four years, above and beyond the company's usual annual productivity improvements. Here's how it hopes to achieve this target.

The exterior of a Macy's store

Macy's laid out a multiyear cost-cutting plan at a recent investor conference. Image source: Macy's.

Using data to boost gross margin

Gross margin optimization provides the biggest opportunity for profit improvement, according to Macy's management, with a potential $275 million to $375 million in annual savings. The company's strategy to boost gross margin relies heavily on making better use of data. (Incidentally, much of the benefit from gross margin improvement will actually boost revenue rather than reducing costs per se.)

For example, Macy's will roll out an initiative called "hold and flow" that it has been testing this year. Rather than distributing all its inventory to stores at the beginning of a season, it will hold back some of the inventory -- perhaps 30% -- and send it during the season to the stores where that product is selling well. This leads to higher sales in stores that see stronger demand, while limiting markdowns in locations where a particular product doesn't sell as well. This is Macy's most promising initiative. It could ultimately boost annual earnings by up to $100 million, according to management.

Macy's is also tweaking its fulfillment algorithms to account for the likelihood of missed sales or markdowns in deciding how to fulfill online orders. Going forward, it might ship an order from a store at a slightly higher cost compared to shipping from a dedicated fulfillment center, if the algorithm determines that the store would likely have to mark down that item to sell it later.

Another way that Macy's will use data to boost gross margin is by timing markdowns by store rather than by region. Today, Macy's has six pricing zones. All stores in each zone implement the same markdowns. That means certain stores miss out on sales by waiting too long to discount aging inventory, while others offer unnecessary discounts on products that were selling well at higher prices. Macy's is now allowing certain stores with strong sales to opt out of zone-based markdowns. In the future, markdowns will be fully automated and specific to each store.

The exterior of Macy's San Francisco flagship store

Macy's will use data on sales trends by store to optimize the timing of markdowns at each location. Image source: Macy's.

Finally, Macy's will begin targeting promotions to customers based on their spending behavior rather than sending all customers with a given rewards program status the same offers. In practice, this probably means it will send fewer coupons to customers who use them to make purchases that are unprofitable for Macy's.

Improved technology will reduce expenses

Macy's also expects to reduce its operating expenses by $125 million to $175 million annually. The biggest savings will come from marketing, where Macy's should be able to refine its marketing mix to get more bang for the buck.

The company also plans to use technology enhancements to cut costs in its stores. For example, it will test self-checkout stations, building on the scan-and-pay option it already offers through its app. Meanwhile, store employees will receive new handheld mobile devices to boost employee productivity. Within a few years, the handheld devices will be able to guide employees by the most efficient path to collect items for online orders that will be picked up in the store or shipped from the store to the customer's home.

Savings should ramp up quickly

Macy's doesn't expect to reap the full annual savings of up to $550 million from its cost-cutting program until 2023. However, management indicated that the company will capture most of the benefit from these initiatives within 12 to 18 months.

As a result, the biggest incremental savings will show up next year, and Macy's will reap approximately $400 million in cumulative cost savings by fiscal 2021. That could potentially drive a return to profit growth for Macy's as soon as next year, particularly because the company will face a fairly easy year-over-year comparison.

On the other hand, Macy's expects its profit (excluding asset sale gains) to decline modestly in the second half of fiscal 2019, despite an easy year-over-year comparison in Q4 and some early savings from its cost-cutting program. This highlights the risk that Macy's cost-saving moves might not fully offset the other headwinds it could face.

The good news is that management seems fairly confident about a return to profit growth by the end of next year, if not earlier. Furthermore, Macy's offers investors an ample margin of safety due to its rock-bottom valuation, its recent debt-reduction efforts, and the company's massive collection of valuable real estate.