Macy's (M 0.44%) stock is down by almost 30% from it's highs of the last year, as investors seem increasingly concerned about the challenges the company is facing. On the other hand, Macy's is still one of the best-run department stores around, and the current valuation looks remarkably attractive. With this in mind, the decline in Macy's stock looks like a buying opportunity.

A brave new retail world
The retail industry is going through a major transformation, as the rise of e-commerce and related technologies is really changing the rules of the game. These kinds of transitions are seldom easy, and companies across the industry are making big efforts to avoid losing too much market share to online players such as Amazon.com. This is arguably one of the main reasons investors and Wall Street analysts are remarkably cautious when it comes to investing in brick-and-mortar retailers nowadays.

Macy's is not immune to a changing competitive landscape, but management has identified the emerging industry trends early in the game, and the company is clearly going in the right direction. Macy's is all about an omnichannel approach to the business, meaning that it aims to provide a seamless shopping experience across multiple channels, be it at the stores, online, or via mobile devices.

Management is keeping the store count under control, and the company has recently announced the closure of 35 to 40 underperforming physical stores in early 2016. It's not as if Macy's is simply reducing its physical presence. Management wants to make sure that it only keeps the best performing locations running, and that those stores are playing the right role in the omnichannel retail parading.

Physical stores are still remarkably important for Macy's in terms of providing differentiated customer service and taking care of the overall shopping experience. Moreover, all of the company's stores can fulfill online orders directly to consumers' homes, and they also serve as locations for customers to pick up the products they bought online.

Management doesn't disclose online sales as distinct to sales at brick-and-mortar stores anymore. Since the lines between the online and physical worlds are blurring, this differentiation doesn't make much sense. A customer can see a product at the store and then order it in a different color or size on a smartphone. Or maybe a purchase order is made online, and the customer picks the product from the store a few hours later.

Making this transition requires time, energy, and money, but it's good to see Macy's is doing its best effort to stay at the forefront of innovation in the retail industry.

Top quality in the bargain bin
Macy's is operating in a difficult environment, but it has one of the best management teams in the industry, and the company is doing a sound job at staying ahead of the curve and adapting to changing consumer demand. While investors shouldn't expect explosive growth rates from Macy's in the short term, the business is fundamentally healthy, and the company looks strong enough to continue delivering solid performance over the coming years.

Importantly, Macy's is valued at a significant discount versus the overall market. Macy's trades at a price-to-earnings ratio of around 12.7 times earnings over the past 12 months. That makes the stock look like a bargain in comparison with a P/E ratio of 18 for the average company in the S&P 500 index. When using forward earnings estimates, Macy's trades at a forward P/E of 11.2, versus a much higher 17 for companies in the S&P 500.

Macy's is paying a dividend yield of 2.8% at current prices. That's not particularly high in comparison with other alternatives in the market. However, it's worth noting that dividends have grown rapidly over the past several years. Macy's has raised dividends in every year since 2010. What was a quarterly payment of only $0.05 back then has now turned into a much larger $0.36 per unit. Over the past four years, Macy's has returned over $7 billion to shareholders in the form of dividends and buybacks.

Wall Street analysts are currently forecasting that Macy's will make $4.71 in earnings per share during the fiscal year ending in January. That means dividend payments are absorbing nearly 30% of earnings, so the company has a lot of room to continue raising payments in the future.

Investing in the best stocks isn't too different from being a smart shopper at a department store. At the end of the day, it's all about buying quality stocks or stocks for a convenient price. At current valuation levels, Macy's is offering considerable upside potential over the years to come.