If a company is making huge profits this year but will not make any profits in the future, it is worthless in the eyes of an investor. But if it loses money this year and next year--and may lose money for a few more years--it can still be very valuable in the eyes of an investor.

Amazon had negative net income in 2012 and basically reported zero net income this year to date. And yet it is worth $166 billion in the eyes of investors.

This is because companies are worth the present value of future cash flows, not current cash flows, and certainly not past cash flows.

Amazon is not the only company that is plowing back all of its incremental profits into growing its business. This is very common for enterprise software companies as well. Salesforce has made or lost a small amount of money every year for the past four years, but it has grown its revenue from $1.3 billion to over $3 billion in those four years. And its market value has gone from $12 billion to $32 billion in the same time frame. Workday hasn't made any profits in the last four years, in fact the net losses have been increasing. But, the stock has doubled in the past year and the company is now worth almost $14 billion.

The lesson here is that you can't just value a company by taking its current performance into account--you need to have a view towards its future performance. You also need to understand why the company is not currently profitable.

In the case of Amazon, it is making huge investments in warehouses and logistics to be able to continue to grow its retailing business. Amazon is also making similarly large investments in data centers to continue its growth in Amazon Web Services business. If Amazon did not want to continue to grow, it could stop making those investments and start generating profits. If you believe, as Amazon management does, that the future growth is going to be there for Amazon, then you ignore the current profit and loss statements and think about what a future P&L might look like.

In the case of Salesforce and Workday, they are making huge investments in sales and marketing to secure additional customers. They are also making significant annual investments in R&D to maintain the market leadership of their existing products and bring new ones to market. If you think that Salesforce and Workday can continue to grow their revenues at or near their current growth rates, then you ignore the current profit and loss statements and think about what a future P&L might look like.

Profits are critical to the health of a business, but that doesn't mean a healthy business has to be currently profitable. A company needs to be able to be profitable if it wants to be and it needs to be profitable at some point in the future--at least hypothetically. So when you read that a company is losing money, don't read that as a bad thing. It could be a very good thing. It all depends on why.

This article originally appeared on Fred Wilson's blog, A VC.