What if you had a crystal ball and could see how earnings would change for your stocks? What would you do if you could see the earnings-per-share outlook deteriorate as end market conditions worsened for your investments? If the answer is "sell immediately," then the one investment lesson I learned in 2016 suggests you might be making a mistake. Here's why.

Not a great year for the economy

Followers of the industrial sector know that 2016 hasn't been a banner year for the industrial economy. Forecasts for production have gotten progressively worse as the year has gone on. Moreover, the weak spots in the industrial economy, energy, and other heavy industries have continued deteriorating and caused a slew of companies to downgrade their expectations.

DATA SOURCE: FEDEX CORPORATION PRESENTATIONS. CHART BY AUTHOR. FEDEX'S SECOND-QUARTER EARNINGS ARE REPORTED IN DECEMBER.

Companies cutting outlooks

The deteriorating macro outlook has also been reflected in the earnings guidance of some of the leading industrial companies. Caterpillar Inc. (CAT -0.11%), Emerson Electric Co. (EMR -0.46%), and Dover Corporation (DOV -0.53%) all have significant exposure to energy spending -- it's not hard to see why they were forced to cut earnings outlooks.

Meanwhile, Rockwell Automation Inc. (ROK -1.85%) is a company largely dependent on industrial companies' willingness to engage in capital spending -- usually the first thing to get cut when growth slows. 3M Company (MMM 0.57%) has relatively large exposure to companies' operating expenditure (which is less likely to be cut in a slowdown compared to capital expenditure), but even that wasn't enough to stop 3M from cutting earnings guidance.

All of these companies have reduced their earnings and sales outlooks as the year has progressed. Here's a glance at their EPS outlooks for the last four quarters:

 Company Q4 2015Q1 2016Q2 2016Q3 2016

3M Company 

$8.10-$8.45  $8.10-$8.45 $8.15-$8.30  $8.15-$8.20 
Caterpillar Inc. $4.00 $3.70 $3.55 $3.25
Emerson Electric Co. $3.05-$3.25  $3.05-$3.25 $2.90-$3.00   $2.98*
Rockwell Automation Inc. $5.70-$6.20 $5.75-$6.15 $5.80-$6.00 $5.93*
Dover Corporation $3.85-$4.05 $3.51-$3.66 $3.35-$3.45 $3.00-$3.05

DATA SOURCE: COMPANY PRESENTATIONS. CHART BY AUTHOR. COLUMN HEADERS CORRESPOND TO LAST FOUR CALENDAR-YEAR QUARTERS (NOT NECESSARILY FISCAL-YEAR QUARTERS). LAST COLUMN FOR EMERSON AND ROCKWELL REPRESENTS THEIR FULL-YEAR EARNINGS.

In short, it's been a difficult year, and one that turned out much worse than most expected it would.

Stock performance

Or has it?

Despite weakening earnings outlooks, investors have made handsome returns on all these stocks. Moreover, the industrial sector has outperformed the broader market. For example, the S&P 500 index is up 6.75% year to date as I write, but the Industrial Select SPDR ETF is up 15.6%. A quick look at the price history of the stocks tells a different story from the tale of woe.

DOV Chart

DOV data by YCharts.

What's going on?

Valuation matters

Simply put, the investment lesson of 2016 is the reminder that valuation matters. A look at a commonly used valuation metric, enterprise value (market cap plus net debt) over earnings before interest, tax, depreciation, and amortization, or EBITDA, shows how relatively cheap these stocks were looking at the start of 2016. Incidentally, EV/EBITDA is a useful indicator because it accounts for a company's debt level -- something the price-to-earnings ratio doesn't do.

 DOV EV to EBITDA (TTM) Chart

DOV EV to EBITDA (TTM) data by YCharts.

Not only were these stocks cheap relative to recent years' valuations, but they were also cheap in relation to the cycle. The latter concept needs some explanation.

Putting this in simple terms, it's common for cyclical stocks to trade on relatively high valuations as the economy deteriorates. That's because their earnings are falling in the downturn. But when the economy recovers (if it does), then their earnings will snap back quickly -- so it's not a bad idea to pay a premium for a cyclical stock at the bottom of the cycle.

However, these stocks were trading cheaply at the start of the year. In other words, they had enough margin of safety to more than account for the deterioration in earnings outlooks.

YOU CAN MAKE MONEY ON STOCKS EVEN IF THEIR EARNINGS OUTLOOK DETERIORATES. IMAGE SOURCE: GETTY IMAGES.

What it all means

All told, it didn't matter that reductions in industrial automation spending and process control hurt sales at Emerson Electric and Rockwell Automation. Nor did it matter that ongoing weakness in energy spending hurt Caterpillar's transportation, energy resources, and construction revenues and Dover's energy and fluid and pumps solutions. Rockwell's full-year 2016 sales declined 6.8%, with adjusted EPS down 7%. In short, not much went right from an end-market perspective for these companies in 2016.

Looking ahead, most commentators are expecting growth in 2017 -- FedEx expects industrial production to increase 2.2% in 2017 -- and if it occurs, these stocks may yet be cheap.  The lesson I'm taking away from 2016 is that sometimes valuation matters in investing, even if earnings outlooks trend in a negative direction.