It's a tough market out there. One way Foolish investors can gain an advantage is by following what creator Joel Greenblatt termed as the "Magic Formula". Legendary value investor Joel Greenblatt's little known valuation tool is signaling a "buy" for two well known companies: Gap (GPS 0.87%) and PetSmart (PETM) right now. Here's why they look so good, and how Mr. Greenblatt's approach can help you pick even more winners, by looking at valuation beyond "cheap" stock prices.   

It's Magic
Joel Greenblatt is a professor at the Columbia University Graduate School of Business, he is the founder of hedge fund Gotham Capital, co-founder of the illustrious "Value Investors Club," and the author of the "Little Book That Beats the Market." The guy is a pedigreed value investing icon, and his method of stock picking beat the S&P 500 by over 13% annually over a twenty year (88-09) period. Think about what beating the market by 13%, every year, would mean for your portfolio over twenty years. 

That same stock picking method is signaling a buy for Gap and PetSmart now. 

On the surface Gap and PetSmart seem to have ordinary valuations; most retail stocks, comparatively, are trading at P/E valuations in the low teens. They both, however, rank among the top fifty cheapest stocks by Greenblatt's "magic formula" valuation. The magic formula approach values stocks outside the traditional valuation tools (P/E, book value, etc.), seeking to tie company performance into valuation. 

This approach looks for stocks with the best combination of a low earnings yield and a high return on capital. Top rated stocks may not have the lowest earnings yield (or "P/E") but they have a relatively low one, when you consider the quality of their business. 

As you can see (below) both of these stocks trade at very reasonable prices in comparison to their earnings. 

PETM Earnings Yield (TTM) Chart

PETM Earnings Yield (TTM) data by YCharts

However, what separates both PetSmart and Gap from other retail stores is the high returns on capital they generate. Both companies return well over 20% of capital, versus an industry average around 15%. As the chart below shows, those returns are growing at a time when most retailers are struggling. 

PETM Return on Invested Capital (TTM) Chart

PETM Return on Invested Capital (TTM) data by YCharts

Return on capital is one of the simplest tools we can use to judge a businesses success. It tells you how much money the business makes, versus the costs of starting and running the business. For every dollar that you give Gap and PetSmart to open new stores, hire employees, and run their business, they're giving you (the investor) more than 25 cents back. 

Performance is key
While the magic formula does a good job of telling us which stocks look cheap now, it doesn't look ahead. Before buying any stock, we should take a look at both its growth trends and competitive position. 

In its most recent quarter Gap reported pedestrian results, with sales growth of just 1% and earnings of $0.58, vs. $0.71 in the same period a year earlier. PetSmart's first quarter earnings rose 6.1%, and sales were up 1.1% year over year, but comparable sales slipped.

We know that retail had a rough first quarter, so these results look less mediocre comparatively. Both companies seem to be doing "ok," and you probably will feel better when you look at the results of other retailers. Further, Gap's comparable sales for this quarter look better, they rose 7% in April and 5% in May, so its full year will likely be pretty strong.

A leap of faith
Buying any retail stock right now takes a leap of faith that goes beyond numbers. Competition from e-commerce is changing the entire landscape for brick-and-mortar retailers. I personally feel most comfortable with retailers that have strong brands, and that offer a unique in-store experience. Both of these companies have strong brands. They each ranked among Interbrand's top fifty most valuable retail brands this year; Gap actually had both its namesake store (22nd) and its Old Navy (24th) brand make the list.

PetSmart, I believe, also offers a unique experience. They do a nice job of getting people in the store, which helps protect pet food sales from e-tailers.  You can see a veterinarian at PetSmart and you can bring your dog in for training, I believe there is a "stickiness" to that experience. Both Gap and PetSmart have enough brand strength to differentiate them from the competition. 

There's no "magic" trick here
At the end of the day, this valuation formula doesn't pick a winner every time. It simply beats the market, on average, when you buy a group of thirty to fifty stocks that rank highly. You should remember that all cheap stocks are cheap for a reason, so you'll need to do some homework on your own before buying. 

What this formula does do, is it forces us to start thinking about valuation beyond "price." We are now buying cheap stocks, only if their business generates high returns on capital. If we use it as a starting point, and screen further for stocks with strong competitive advantages, who knows, we could do even better than the magic formula. 

I feel that both PetSmart and Gap pass that test. They have cheap valuations, high returns on capital, and reasonably good growth prospects. Both stocks are probably worth a look from value minded investors.