NEW YORK (TheStreet) -- If you are considering investing in retail, here is something to consider:

Amazon (AMZN - Get Report) has a larger market cap than Wal-Mart (WMT - Get Report) now, $251 billion vs. $237 billion.

However, Amazon generates less than one fifth the sales of Wal-Mart. For every $100 Amazon sells, Wal-Mart sells $507. Over the last 12 months, Amazon had annual sales of $96 billion versus $485 billion for Wal-Mart.

It's not like Wal-Mart's business is a little bigger than Amazon's -- it's much bigger. Wal-Mart's inflation adjusted sales in 1994 were larger than Amazon's are today.

In business, revenue is not what really matters. Businesses are typically measured by profit. Wal-Mart far outshines Amazon in the profit department. Over the last 12 months, Amazon has lost $188 million, while Wal-Mart has generated net profits of $15.8 billion.

I don't know about you, but I'd rather own the business that generates $15.8 billion in profits than the one that loses $188 million.

An investment's value is the sum of future cash flows discounted to present value. Wal-Mart very clearly has tremendous cash flows. Amazon does not. Wal-Mart is also very shareholder friendly. The company has paid increasing dividends for over 40 consecutive years. Warren Buffett has taken notice. Wal-Mart is one of his largest high yield dividend stock holdings. (Click here to see Warren Buffett's top 20 high yield dividend stocks.)

Of course, present value calculations require a growth rate, and that's where Amazon excels. Investors are expecting the company to continue growing rapidly.

So far, Amazon has not disappointed. The company has compounded revenue-per-share at 28.3% a year over the last decade versus 7.9% a year for Wal-Mart. Amazon has continued its rapid growth recently. The company posted year-over-year sales growth of 19.9% in its most recent quarter.

If you select your investments based solely on expected growth rates, Amazon is the winner between the two companies, and it isn't close.

Finding Amazon's Real Profitability

Amazon's aggressive growth plans obscure its true profitability. The company is losing money on a GAAP basis, but is actually profitable from a business perspective.

The reason this is so is because Amazon's investments in technology cause depreciation to be overstated. Fortunately, Amazon is transparent enough to give investors a fairly straightforward way to see true earnings power.

It is important to note that Amazon buys/invests in building, machinery, software, and hardware in two ways. It will either buy outright, or use long-term leases.

Over the last five quarters, Amazon has capital expenditures of about $23 billion on outright purchases, and $19 billion capital expenditures using long-term leases. About 55% of capital expenditures for Amazon are normal purchases, and 45% are capital leases.

Principal repayments on capital leases are an excellent 'back-of-the-envelope' way to gauge real world depreciation costs (not accounting depreciation costs).

Amazon had just under $2 billion in principal repayments on capital leases in its last 12 months. If we adjust this number to account for the fact that capital leases represent just 45% of capital expenditures, we come to a 'real world' depreciation charge of $4.4 billion a year.

Amazon's "true" earnings power is its current operating income ($2.7 billion over the last 12 months) plus the difference of GAAP depreciation and 'real world' depreciation (this comes to about $1.1 billion a year). The company's pre-tax adjusted earnings are about $3.8 billion before taxes. Using a 33% tax rate, Amazon's real earnings power is about $2.6 billion.

Amazon Versus Wal-Mart

As mentioned earlier, Wal-Mart had net profits of $15.8 billion over the last 12 months. Compare this to Amazon's $2.6 billion in profits over the same time period. Wal-Mart has over six times the amount of profits as Amazon, yet it costs less than Amazon.

Wal-Mart has grown earnings per share at 7.6% a year over the last decade. I expect Wal-Mart to grow earnings per share at between 6% and 9% over the next decade. This comes to an average expected growth rate of 7.5%, in line with the company's historical average.

If you combine Wal-Mart's 7.5% expected growth rate with its current 2.7% dividend yield, you get expected returns of 10.2% a year. Let's round this down to 10% to be conservative.

Now, let's assume that Amazon continues growing at 20%. This is not entirely realistic; the company's growth will slow at some point as its size continues to increase. If growth didn't slow, the company would eventually become impossibly large. Amazon doesn't pay dividends, so we don't need to include that in our analysis.

Using a 20% growth rate for Amazon, and 10% for Wal-Mart (which includes the effects of reinvested dividends), it will take Amazon 21 years to pass Wal-Mart's earnings per share.

I am a long-term investor, but making a bet that a company will be larger 21 years into the future doesn't seem very practical to me.

Keep in mind, this analysis assumes that Amazon continues to grow at 20% a year. It is exceptionally unlikely the company can grow at that rate for another 2 decades. When Amazon's growth falters some, it will likely see its valuation multiples come crashing down.

The Bottom Line

I shop at both Amazon and Wal-Mart. Amazon is an amazing business. Unfortunately, the stock is wildly overvalued at current prices.

Wal-Mart on the other hand, is likely undervalued. The company is currently trading at a price-to-earnings ratio of 14.6 - versus 96.5 for Amazon (using adjusted earnings).

Stocks with high price-to-earnings ratios have significantly underperformed low price-to-earnings stocks over the long-run.

Maybe times are changing, but I doubt it. Amazon is simply not priced to give investors solid returns over a long-time period. Wal-Mart offers investors a nice mix of stability (40+ years of consecutive dividend increases), current income (2.7% dividend yield), growth (7.5% expected earnings-per-share growth rate), and value (14.6 price-to-earnings-ratio). As a result, the company is a long time favorite of The 8 Rules of Dividend Investing.

This article is commentary by an independent contributor. At the time of publication, the author held a position in WMT.