Long-term investing can sometimes be a wild ride, as we can see from the ups and downs of 2020. But if you hold onto great companies and let them sit for fifty years, you can retire with lots of money in the bank. Target (TGT 1.97%), Costco (COST 0.11%), and PepsiCo (PEP 0.06%) are all great companies that will continue to succeed and bring gains to shareholders over the long term.

Target: Cheap, chic, and very valuable

Target has been one of the biggest winners of the pandemic, as customers flocked to its stores that remained open, and took advantage of its many efficient omnichannel shopping options. 

In the second quarter ended Aug. 1, comps grew 24%, the most ever. Stores were open and contributed to the successful quarter, but the star was digital, which increased 195%.

Target worker wearing a mask and gloves.

Image source: Target.

Target was a leader in digital retail shopping well before the pandemic hit, putting it in an excellent position while there were lockdown orders. Same-day services grew 273% in the second quarter, and Shipt same-day delivery services, which Target bought in 2017, grew 350%.

90% of digital orders were fulfilled in stores in the second quarter, providing a cost-effective approach to e-commerce that allows the company to make a profit from strong ordering.

Target's discounted prices and own brands are also a big draw for customers. It's agile enough to experiment with smaller store formats and new brands, and it also still has a relatively small store fleet, with 1,898 U.S. stores versus Walmart's (WMT 1.18%) 4,753. It already has 50 more stores in the works in several states.

Target stock is up 21% year to date and trading at a model 22 times 12-month trailing earnings, making it a great time to buy in.

Costco: A unique and very popular model

Costco was one of the other big winners over the pandemic, with open stores and strong digital growth. The big-box grocery chain charges a membership, $60 for the basic model and $120 for an executive membership. Members continually increase, growing to 101.5 million at the end of the fourth quarter on Aug. 30. Renewal rates in the U.S. stayed steady at 91%, and the membership fees alone accounted for more than $1 billion during that quarter.

Woman scanning food at register, wearing a mask and gloves.

Image source: Getty Images.

The bulk-buy king had some of its best quarters over the pandemic. Net sales rose 12.5% in the fourth quarter, and earnings per share grew to $3.13. That high growth continued into September, with net sales up 15.5%, and e-commerce up over 90%.

Costco operates 552 U.S. and 244 international warehouses, which gives it plenty of room to grow. But comps are equally valuable. CFO Richard Galanti pointed out that in a regular cycle, comps are about 5% to 8%, but recently they've been around 14%. That means Costco is a winner even during rough times.

Costco stock is up 24% year to date and is trading at a hefty 40 times trailing 12-month earnings. But that shouldn't scare investors. The company is a dependable choice for further growth and will reward shareholders who hang on for 50 years.

PepsiCo: The right formula for growth

PepsiCo has grown from a soft drink company to include snack and breakfast products. This strategy became very important during the pandemic, as the company outdid rival Coca-Cola (KO 0.94%), fueled by strength in these other segments.

Two cans of soda on ice.

Image source: Getty Images.

The company came back to growth with a 5% increase in sales in the third quarter after a 3% decline in the second quarter, generated by drops in its away from home division. Snacks and breakfast were still the stars of the quarter, with 6% organic revenue growth for each versus 3% for beverages.

The diversified product line was an important factor in PepsiCo's success, but the company does a lot of things right. New products, such as Gatorade Zero and Mountain Dew Zero Sugar, performed well so far this year, and Pepsi Zero Sugar U.S. sales are up 30% year to date.

In contrast to Coca-Cola's new strategy of cutting underperforming products, PepsiCo CEO Ramon Laguarta said:

We are content with the composition of our portfolio and are more focused now on maximizing the full potential of our existing and recently acquired assets to drive improved growth and returns over time as we aim to become an even faster, stronger and better organization.

Pepsico's focus on what works in beverages plus its diversified product line means it performs well under duress, like now. But it also gives it more agile in general and gives it more room to run in the future. And in the years leading up the pandemic, PepsiCo performed much better than rival Coca-Cola on the whole.

PepsiCo stock is just about flat year to date, making now a great time to buy some shares on sale.