While the S&P 500 has increased by more than 25% this year, not all stocks have benefited from the market's gain. The following stocks have badly lagged the overall market this year for various reasons.

While that doesn't necessarily mean this is a good time to buy, each warrants a closer look.

Three people sitting around a table with computer monitors in front of them.

Image source: Getty Images.

1. Johnson & Johnson

Johnson & Johnson's (JNJ -0.43%) stock price has gained only 3% this year. This is partly due to the well-publicized issues with its COVID-19 vaccine. Following reports of blood clots, the U.S. Centers for Disease Control and Prevention and the Food and Drug Administration recommended pausing the use of the vaccine.

However, while last year's results were hurt by COVID-19 for a variety of reasons, this year has been solid. In the third quarter, Johnson & Johnson's adjusted sales increased by 10.6%

In an effort to unlock shareholder value, the company recently announced a plan to spin off its consumer health business. This is a slower-growing business than the medical devices and pharmaceuticals segments. Consumer health's sales grew by less than 6% in the recent quarter.

But the new stand-alone business will have powerful brands. These include Band-Aid, Tylenol, Motrin, Nicorette, and Listerine, to name just a few. These products do well no matter the state of the economy.

Meanwhile, Johnson & Johnson can concentrate on producing newer treatments and products for the faster-growing pharmaceuticals and medical devices businesses.

2. Walmart

Walmart's (WMT 0.53%) stock has been flat this year. While it's nice not to lose any money, that's far behind the S&P 500's gain.

Earlier this year, investors were taken aback by management's lukewarm guidance. At that time, Walmart expected flattish adjusted operating income.

However, its fiscal third-quarter operating income rose by almost 6.5% after excluding divested businesses from last year's results. This covered the period that ended Oct. 31.

Even better, management increased its expectations a couple of times this year. In August, it raised its operating income guidance to an 11.5% to 14% increase.

Walmart also plans to spend $13 billion to focus on the supply chain, automation, and customer-facing technology. These steps should help the company keep pace with online competitors, namely Amazon.

With Walmart's focus on low prices and omnichannel initiatives that allow customers the convenience of buying and receiving goods in a multitude of ways, the company is well positioned for the future.

3. Walt Disney

Walt Disney's (DIS -0.27%) stock is down by more than 15% this year. There's no getting around the fact that COVID-19 hurt the company's results by shutting down its theme parks, delaying movie releases, and stopping live-action sports that hurt ESPN, its sports network. Out of caution, the board of directors suspended Disney's dividend.

More recently, investors have been dismayed by slowing growth at its streaming service, Disney+. In 2020, the number of paid subscribers skyrocketed to 94.9 million from the prior year's 30.4 million, undoubtedly helped by people stuck at home. In the recently completed fiscal year, which ended in October, there were 118.1 million subscribers, but this only increased by about 2 million from July. But with a ton of content coming out that will make its way to Disney+, this slowdown will likely prove temporary.

More importantly, Disney has become a global media empire. So even if the streaming service's growth lags for a while, other pieces of the business will pick up the slack. This includes television networks, theme parks, movie studios like Disney, Pixar, Twentieth Century, and Marvel, and retail stores. Even with its streaming service's slowing subscriber growth, fourth-quarter revenue rose by 26%.

With such great properties and content, I have no doubt about Disney's long-term prospects.

These three companies all seem worthy of an investment. Aside from establishing great franchises, each has taken steps to ensure a bright future. Johnson & Johnson is breaking itself into two, but remains a rock-solid business. Walmart, established as the low price leader, continues to invest in technology to keep up with the times. And Disney continues to expand, including buying Twentieth Century Studios and launching its streaming service a couple of years ago.

Attractive brands and astute moves to position their companies for the future would seem to add up to attractive long-term investment opportunities when you consider their stocks have trailed the market this year.