By mixing and matching numbers you can create millions of financial ratios. Only a handful, however, will be of any use. Even fewer will be reliable predictors of future stock performance. Such is the difficulty of picking stocks with a ratio.

But if any ratio can stand alone as having some inherent ability to pick good stocks, return on invested capital would certainly make the short list. Here's why ROIC should be in your investing toolbox.

What makes ROIC special?
Return on invested capital works because it looks through many of the weaknesses that plague simpler financial ratios. It seeks to determine how much a company earns on the entire amount of capital invested in its core business.

Return on invested capital is said to be "agnostic" to a company's capital structure. That is, it isn't affected by management's choice to pile on debt, or to run a business financed purely with shareholder equity. This is one of the biggest weaknesses of more commonly known ratios, such as return on equity and price to earnings, which are directly and indirectly affected by a company's financing choices.

Because it is capital-structure neutral, one can directly compare ROIC across companies, even if the two businesses have different balance sheets.

Return on invested capital also surveys a business as an investment opportunity from the inside. While the P/E ratio tells you how much you have to pay for \$1 of a business's earnings, ROIC tells you the return (as a percentage) a company earns by investing capital in its business.

The math behind ROIC
For those familiar with accounting, this will be a refresher. For those new to financial statements, it might come as a challenge (but you'll get there, I promise!).

The equation for ROIC looks like this:

The "exploded view" of broken-down terms would look more like this:

Explaining the numerator
There are two main reasons why ROIC uses NOPAT in the numerator. First, NOPAT is not affected by interest expense and the resulting tax benefits, which occur below the operating income line.

Second, NOPAT includes only operating income -- income from the core business. It doesn't take into account income from less predictable and less repeatable sources such as the gains on an investment portfolio.

Explaining the denominator
The denominator is basically a company's total balance sheet with some dead weight removed. By removing "excess cash" from the denominator, practitioners can avoid the so-called "cash drag" that tends to weigh down the performance of cash-rich companies. After all, if a dot-com company keeps \$20 billion in the bank all year, it's hard to say it really needs this cash on hand to continue operations. It's idle capital, not invested capital.

In addition, we throw out noninterest-bearing current liabilities because they by definition are not invested capital. Noninterest-bearing current liabilities (accounts payable being a great example) are capital that is not contributed by investors, but which is certainly key in financing a company.

You'll find that companies with a high ROIC often have an uncanny ability to persuade noninvestors (suppliers, for instance) to finance a significant part of their balance sheets with noninterest-bearing liabilities. This is why Warren Buffett loves companies that can generate a so-called "float" from their operating activities.

Calculate ROIC with me
We'll use Wal-Mart (NYSE:WMT) as an example for calculating ROIC by using numbers from the retailer's annual report for the year ended Jan. 31, 2014. Follow along with me.

First, we have to determine NOPAT. To do so, I'll take Wal-Mart's operating income of \$26.87 billion. Then, I'll multiply this figure by 67%, keeping roughly in line with its 10-year average tax rate of about 33%. This gives me Wal-Mart's NOPAT of \$18 billion -- the numerator.

Now the more subjective part -- the denominator. At the end of the year, Wal-Mart had \$204.75 billion of total assets. It had little, if any, excess cash. Cash totaled just \$7.3 billion, practically nothing for a company of its size. I'll put in a zero for excess cash, knowing full well that even excluding all of its cash as excess cash would have a de minimis impact on the end result.

Noninterest-bearing current liabilities are a massive source of balance sheet financing for Wal-Mart. Average accounts payable and accrued liabilities were \$37.7 and \$18.8 billion, respectively, for fiscal 2014. Together, these items tally to \$56.5 billion; when subtracted from total assets of \$204.75 billion, we get \$148.25 billion in invested capital.

Thus, Wal-Mart's ROIC is equal to \$18 billion divided by \$148.25 billion, or 12.1% for that year.