Many investors are frustrated that Macy's (NYSE:M) hasn't moved more aggressively to sell its most valuable real estate. While the company has brought in nearly $1 billion of proceeds from real estate sales in the past two years, that's just a small fraction of its total real estate value. In early 2016, hedge fund Starboard Value estimated that Macy's real estate was worth $20.7 billion.

However, Macy's has been carefully pruning its store portfolio, selling only lower-performing stores and stores that clearly overlapped with other Macy's locations. Yet even among its stores in the worst malls, Macy's has sometimes found a meaningful amount of real estate value.

Macy's gets a windfall in Alexandria

One of Macy's bigger real estate transactions of the past year was a deal to sell its store building and the surrounding land at Alexandria, Virginia's Landmark Mall to developer The Howard Hughes Corporation (NYSE:HHC).

For several years, Howard Hughes has been working on a plan to redevelop the entire mall. It wants to knock down the main mall building -- which has been nearly vacant in recent years -- and replace it with a mixed-use "town center" development.

A car dealership's inventory parked in front of the former Macy's at Landmark Mall

There are lots of cars parked at Landmark Mall -- because it's now long-term storage for a car dealership. Image source: Author.

Originally, Macy's had planned to keep its store open as the mall was converted to a town center setup. However, Landmark Mall has become a classic "dead mall," and customer traffic isn't likely to improve until Howard Hughes finishes the redevelopment process. Furthermore, Macy's has two other locations within a 10-15 minute drive, both of which are among its 150 most profitable stores. As a result, Macy's announced in January that it would close the store.

Yet while Landmark Mall is virtually vacant today (it has a Sears store, but that's it) it is located in a wealthy area that has high potential. As a result, Macy's was able to sell the parcel to Howard Hughes for $22.2 million, according to local property records. That's a considerable sum to get for a store that may have been barely profitable.

Macy's sells another failing store

Another one of the dozens of stores that Macy's has closed this year was its Boulevard Mall location in Las Vegas. This is another struggling mall that is being killed by competition. Among the 10 malls in the Las Vegas metro area, it is the only one that gets a "C" or "D" grade from Green Street Advisors for sales productivity.

Closing the Boulevard Mall store was also a no-brainer. Macy's has several other stores in the Las Vegas metro area, including two at Fashion Show Mall, which is just two miles away. Fashion Show Mall has an A++ grade from Green Street Advisors, putting it among the top three dozen malls in the U.S. Not surprisingly, Macy's Fashion Show Mall stores are also among its 150 most profitable locations.

Last month, Macy's sold its store building at the Boulevard Mall for more than $3.5 million. While this wasn't as big a windfall as what Macy's got in Alexandria, it's still a significant sum, considering that the Boulevard Mall may be dying a slow death. (J.C. Penney also plans to close its store there within the next month.)

Macy's holds onto its best stores

While Macy's hasn't brought in billions of dollars from selling real estate -- as some investors had hoped -- that's because it has held on to nearly all of its top-performing stores.

Macy's management remains confident that the company can improve its profitability in the coming years by revamping its marketing strategy, focusing on more exclusive merchandise, and implementing a new loyalty program. If these plans succeed, investors will be glad that the company didn't auction off its best real estate to the highest bidder.

On the other hand, if Macy's turnaround efforts fall short in the coming years, the company can go back and start selling off its more valuable stores. The best malls have been increasing their dominance recently, so these properties are likely to retain their value quite well.

Considering how much money Macy's has brought in this year from selling real estate in dead and dying malls, it's clear that the company's best properties represent a gold mine of real estate value.

Adam Levine-Weinberg owns shares of J.C. Penney and Macy's. The Motley Fool recommends Howard Hughes. The Motley Fool has a disclosure policy.