It's a classic investment conundrum: Do you want to buy a stock that has near-term headwinds, but still looks like a good value nonetheless? That's the question that faces investors and potential investors in Illinois Tool Works (NYSE:ITW). Unlike shares of a peer such as 3M Company (NYSE:MMM), there's still a strong case to be made for buying Illinois Tool Works' stock. Here it is.

Illinois Tool Works has near-term headwinds

Check out the latest Illinois Tool Works earnings call transcript.

Along with much of the industrial sector, the stock was sold off aggressively in 2018 on fears of an upcoming cyclical slowdown in the economy. Moreover, it was a particularly brutal year for companies with significant exposure to the automotive industry, given that U.S. light vehicle sales looked like they'd passed cyclical peak, and end-market conditions are likely to get worse in 2019.

For reference, Illinois Tool Works' automotive OEM (original equipment manufacturer) segment generated more than one-fifth of operating income in the first nine months of 2018:

ITW Chart

ITW data by YCharts.

Moreover, if prices for commodities (particularly oil) remain relatively low, then some of the company's businesses with exposure to heavy industries (such as welding, and test and measurement) are likely to come under pressure. Throw in any negative impact from the China-U.S. trade dispute, and it's clear that the company faces some cyclical risk in 2019. As a consequence, analysts have been downgrading the stock.

Clearly, there are question marks around the company's prospects in 2019, but there are two reasons why the stock is still attractive.

Illinois Tool Works stock looks like a good value

First, the company's valuation gives it a significant margin of safety to deal with any disappointment. For example, the chart below shows how its price-to-FCF (free cash flow) valuation started to drop significantly as FCF improved and the stock price dropped in 2018. In contrast, 3M is looking expensive, even as it faces many of the same cyclical headwinds as Illinois Tool Works:

ITW Price to Free Cash Flow (TTM) Chart

ITW Price to Free Cash Flow (TTM) data by YCharts.

To put this into context, the company's FCF expectation for 2018 puts it at a price-to-FCF valuation of around 17. Even if Illinois Tool Works generates zero growth in FCF in 2019, it's still a good value. For 2019, management is currently forecasting organic revenue growth of 2% to 4%, and EPS (earnings per share) growth of around 6%.

Illinois Tool Works' self-help initiatives

Second, a distinguishing characteristic of the company's performance in the last five years is the margin expansion that management has squeezed out of the business by applying its enterprise strategy. The chart below shows just how much of it has come from enterprise initiatives, compared to price/cost and volume improvements:

Illinois Tool Works Margin Expansion

Data source: Illinois Tool Works presentations. Bp = basis points (100 bp = 1%). Chart by author.

In a nutshell, management has taken the knife to underperforming businesses and trimmed unprofitable product lines, while focusing on its most profitable customers. The results have been startling: From 2012 to 2018, operating margin has improved from 15.9% to between 24% and 25%, and EPS has improved at a compound annual growth rate of 15%. Management expects even more to come in the next few years.

For example, operating margin is expected to improve to 28% in 2023, with strategic initiatives and strategic sourcing contributing 2% to 3% growth. In other words, even with zero revenue growth, margin expansion should lead to growth in earnings and cash flow.

A stock price chart

Image source: Getty Images

Is this a stock to buy?

Putting these two points together creates a picture of a stock that trades at an attractive valuation (even with no growth in 2019), and has prospects of margin expansion through self-help initiatives. In other words, Illinois Tool Works can still do well in 2019 even in a difficult environment.

Moreover, the assumption that the economy will slow down in 2019 doesn't mean a recession is around the corner. Illinois Tool Works can grow earnings in a slowing growth environment, and given its valuation, there's plenty of upside potential if the economy avoids a recession. On a risk-reward basis, Illinois Tool Works is attractively priced for long-term investors.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.