Macy's (M 1.78%) is recovering successfully from the initial devastation caused by the coronavirus pandemic when it temporarily had to turn away shoppers from its stores. Unsurprisingly, revenue fell dramatically, but management pivoted quickly to enhance the digital business. 

As a result, Macy's is in a better position now than before the outbreak. Those improving prospects have investors circling, asking if now is an excellent time to buy Macy's stock. 

Macy's is a leaner business

Macy's revenue exploded by 39.8% to $25.3 billion in its most recently completed fiscal year. To put that growth into context, Macy's has compounded annual revenue at a negative 0.4% rate over the last decade. Before the outbreak, Macy's struggled with consumer shopping habits that were increasingly moving online. That was terrible news for a company that derived most of its sales from its sizable, mall-based, brick-and-mortar stores.

This was as Amazon (AMZN -1.61%) was growing sales rapidly and taking market share away from physical stores. The trend had many analysts calling it a retail apocalypse, forcing businesses that couldn't adapt to shut their doors permanently. Macy's was slow to adjust to changing consumer habits. Sales at physical stores are more profitable than online because Macy's does not have to ship the order to people's homes. Moreover, when shopping in person, folks make impulse purchases they weren't planning on, increasing the average sale per trip.  

Management was hesitant to invest in the digital business for fears it would take away from the lucrative brick-and-mortar side. However, the outbreak forced Macy's hand; it had to close its stores, with no certainty of when it could reopen. At that point, it had to move online in a significant way.

The shift is paying off. Digital sales surged, it helped Macy's attract millions of new customers, and surprisingly, the online business made its stores more valuable. The physical locations could be used as fulfillment centers, offering customers the option to pick up online orders in stores. That way, Macy's will save on shipping expenses. 

That wasn't the only major change management engineered during the pandemic. Macy's cut costs dramatically, laying off employees, reducing office space, and finding efficiencies anywhere it could. That, too, is paying off handsomely. Macy's generated a gross profit of $10.3 billion in its most recently completed fiscal year. At the same time, it earned an operating income of $2.3 billion.

Compare that to its fiscal year 2019, when it earned a gross profit of $10.5 billion and an operating income of $1.5 billion. From this comparison, it's clear to see the impacts of management's reduction in operating expenses.

An excellent business at a bargain price 

M Price to Free Cash Flow Chart.

M Price to Free Cash Flow data by YCharts.

Fortunately, investors can buy this excellent business near to its lowest valuation in years. Macy's is trading at a price-to-earnings multiple of 3.5 and a price-to-free-cash-flow ratio of 3.4; the stock has scarcely been cheaper in the last decade.

Of course, there are risks that Macy's earnings and cash flow will fall if the U.S. enters a recession, but there is enough margin of safety in the valuation to alleviate this concern. Additionally, investors should not expect explosive returns from Macy's stock. After all, it's not a high-growth tech stock. Still, it's an excellent business at a bargain price, and investors can feel good adding it to their portfolios.