2023 has been a great year for the stock market: The Nasdaq Composite has rocketed 31.1% higher, and the S&P 500 is up over 15%. But not all stocks have joined the party.

Air Products and Chemicals (APD 0.43%), Northrop Grumman (NOC -1.56%), and Trimble (TRMB 1.59%) are all underperforming the major indices. Air Products and Northrop Grumman are down year to date, and Trimble remains down 45% from its all-time high.

Here's why each out-of-favor industrial stock is worth buying now.

Three people smile while collaborating on a laptop in a cafe.

Image source: Getty Images.

Buy a dividend darling on the dip

Scott Levine (Air Products): While there are indications that we're on the verge of a bull market, not every stock has fared well recently. Industrial gases supplier Air Products has seen its stock fall 10.6% over the past six months, a period in which the S&P 500 has risen 10.8%. Air Products, however, is a name that's likely familiar to income investors, considering the company's consistent history of hiking its dividend for more than 40 years. So now seems like a particularly great time for patient investors to pick up Air Products, with its current forward dividend yield of 2.4%.

Supplying industrial gases and related equipment to a variety of industries, Air Products is a stalwart in its field. Its formidable economic moat is one of its leading competitive advantages. But its growing presence among hydrogen companies is particularly appealing.

Already Air Products is a leader in hydrogen production, but it has several projects in development that will expand its presence even further. For example, the company is one of several partners involved in a joint venture to develop a major "green hydrogen" facility in Saudi Arabia that will have a daily production capacity of 600 metric tons by the end of 2026. Some forecasts estimate that the global hydrogen market could reach $10 trillion by 2050 -- and Air Products could be at the forefront.

Bolster your portfolio with a reliable defense contractor

Daniel Foelber (Northrop Grumman): Northrop Grumman is down a painful 16.8% year to date , and is heavily underperforming its peers:

NOC Chart

NOC data by YCharts.

The defense contractor is putting up strong results, especially relative to a record 2021. However, investors are showing intolerance of the company's short-term struggles and little patience to wait and see whether its space investments pay off. In fact, Northrop's revenue, earnings, and operating margin are all declining:

NOC Revenue (TTM) Chart

NOC Revenue (TTM) data by YCharts.

Besides Boeing (which suspended its dividend in 2020), Northrop has the lowest dividend yield of the defense majors at just 1.6%, making it a relatively unattractive passive income play. However, Northrop did recently raise its quarterly dividend by 8% to $1.87 per share. And the company has the lowest price-to-earnings ratio of the defense majors.

Like most defense contractors, Northrop has a diversified business. Its four operating segments cover aeronautics, defense, mission, and space, with operating income and sales spread out nicely across all four segments.

In sum, Northrop looks like a good all-around value for investors looking for a defense stock to buy now.

The long-term benefits outweigh the near-term negatives

Lee Samaha (Trimble): Trimble helps transportation, geospatial, agricultural, and construction and infrastructure companies with positioning and modeling. It has a long-term growth opportunity in supporting their daily workflows with analytics. For example, a construction activity can be precisely monitored and controlled using Trimble's software and guiding technology.

While its long-term prospects are excellent, the company is going through a sticky patch. Management was forced to lower its revenue expectations for a recent acquisition, European transportation platform company Transporeon, due to deteriorating conditions in Europe. Moreover, a sales decline in the first quarter left investors concerned that the company's growth is about to slow.

While it's never good news to see lowered sales, this quarter's primarily reflect a correction as dealers reduced product inventory, having rushed to increase it last year -- Trimble was able to ship more hardware products following the supply chain crisis. In contrast to the 15% organic year-over-year sales decline in products, Trimble's subscription and services sales improved 14% on a year-over-year organic basis.

Moreover, its annualized recurring revenue (ARR), a measure of contract value and recurring revenue that's extrapolated over the full year, grew 13% organically in the first quarter. ARR is the key metric that management is focusing investors' attention on.

Given that the stock trades at around 20 times the midpoint of management's earnings guidance for 2023, it looks like an excellent value for a company growing at an underlying rate in the mid-teen percentages.