Here's how much money you’d have if you invested $1,000 in Walmart 10 years ago

Robyn Beck | Afp | Getty Images

About 10 days ahead of Black Friday — one of the most anticipated shopping days for merchandisers — big-box retailer Walmart reported better-than-expected revenue and earnings.

And good news for consumers: The company plans to set prices for Thanksgiving staples at the same level as 2021.

For the fiscal third quarter, Walmart generated more than $152 billion in total revenue, eclipsing the nearly $148 billion Wall Street analysts expected. The company also reported adjusted earnings per share of $1.50 for the quarter, compared to the $1.32 analysts expected.

Walmart saw growth in its grocery sales this quarter as it rolled out various deals to draw in budget-conscious consumers.

"Through our Deals for Days events in the U.S. and a Thanksgiving meal that will cost the same as last year, we're here to help make this an affordable and special time for families around the world," Walmart CEO Doug McMillon said in a press release.

Shoppers will be able to take advantage of savings for holiday meal items through Dec. 26, according to Walmart's website.

In addition to increased grocery sales, Walmart also got a boost from a strong back-to-school shopping season in the U.S. and global sales events in countries such as India and China, McMillon said on a call with investors.

Back in the second quarter, Walmart's earnings also surpassed Wall Street analysts' expectations as inflation-pinched shoppers sought out affordable necessities like groceries over discretionary merchandise such as clothing.

What this means for investors

Walmart shares jumped on Tuesday, following the company's earnings call and closed at a price of about $147 per share. Here's how much money you would have as of Nov. 15, 2022 if you had invested $1,000 into the company one, five and 10 years ago.

If you had invested $1,000 into Walmart a year ago, you'd see a slight return on your investment and have about $1,019 as of Nov. 15, according to CNBC's calculations.

If you had invested $1,000 into Walmart five years ago, your investment would be worth around $1,761 as of Nov. 15, according to CNBC's calculations.

And if you had invested $1,000 into Walmart a decade ago, your investment would have more than doubled in value and be worth about $2,443 as of Nov. 15, according to CNBC's calculations.

Walmart is expected to continue to perform well over the holiday season since the company's focus on low prices is expected to continue to attract price-conscious consumers, Deutsche Bank analyst Krisztina Katai predicted ahead of the earnings report.

However, Walmart's performance could be hurt by various factors, such as shifts in consumer buying habits or further increases in labor costs, Katai adds.

Investors should always do their homework

With that in mind, it's always important to remember that a stock's past performance shouldn't be used as an indicator of how well it will perform in the future.

Given the unpredictability of the stock market, a passive investing strategy tends to make sense for most investors, rather than investing in individual stocks.

Investing in a market index, like the S&P 500, can be a great way to get started. Since the S&P 500 tracks the stock performance of large American publicly traded companies, investing in an S&P 500 index fund or exchange traded fund (ETF) can be a great way to gain exposure to a number of well-known companies.

As of Nov. 15, the S&P 500 declined by about 15% compared to 12 months ago, according to CNBC's calculations. However, the index has increased by about 55% since 2017, and grown by about 196% since 2012.

Want to earn more and work less? Register for the free CNBC Make It: Your Money virtual event on Dec. 13 at 12 p.m. ET to learn from money masters like Kevin O'Leary how you can increase your earning power.

Don't miss: Apple just announced its new iPhone 14—here’s how much you’d have if you invested $1,000 a decade ago

Bringing in $144,000 a year as a female truck driver
Bringing in $144,000 a year as a female truck driver