As a long-term investor, it's usually in your best interest to ignore the stock market's short-term volatility. After all, volatility is inevitable, and paying too much attention can cause more stress than good. However, that doesn't mean you should be oblivious to what's happening because you could miss good opportunities.

During market down periods like we're currently having, you can find some great companies trading at great prices through no fault of their own. If you have $3,000 that you don't need to pay down short-term debt, bolster an emergency fund, or pay monthly bills, here are three stocks worth buying right now for the long term.

1. Microsoft

Microsoft (MSFT -0.18%) saw its stock price decline over 25% so far in 2022. And yet, that price drop is what makes the tech giant an attractive buy right now. If a recession occurs in 2023 -- which many experts are forecasting -- Big Tech will likely take a hit because spending by consumers will slow. What separates Microsoft from its other Big Tech competitors and better equips it to handle a recession is that it has so many different revenue sources to keep it growing. Here's how its 2022 fiscal year revenue breaks down by segment:

  • Server products and cloud services: 34%
  • Office products and services: 23%
  • Windows: 12%
  • Gaming: 8%
  • LinkedIn: 7%
  • Search advertising: 6%
  • Devices: 4%
  • Enterprise services: 4%
  • Other: 2%

Aside from the diversification, an underrated aspect of Microsoft's revenue streams is that a good portion of it is business-to-business. Countless companies worldwide rely heavily on Microsoft's products and services, which will prove extremely valuable in the foreseeable future as consumer spending is expected to decline because of broader economic conditions.

Despite having a market valuation topping $1.8 trillion, the long-term growth potential for Microsoft still looks bright. In the fast-growing cloud computing sector, Azure, is the second-largest cloud platform by market share, trailing only Amazon Web Services. It will become a real competitor in the video game industry if the FTC approves its $68.7 billion acquisition of Activision Blizzard. And because a lot of Microsoft's revenue comes from software, its gross profit margins are higher than many competitors.

MSFT Gross Profit Margin (Quarterly) Chart.

DATA BY YCharts.

2. Procter & Gamble

The products and services that a company offers to consumers tend to fall into one of two broad categories: consumer staples and consumer discretionary. Consumer staples are generally essential items that consumers purchase in all economic environments and regularly replenish. Consumer discretionary products and services are considered non-essential and/or are purchased infrequently. Procter & Gamble (PG -0.13%) largely deals with the former.

With billion-dollar brands like Pampers, Tide, Bounty, Tampax, Gillette, Old Spice, Dawn, Crest, and countless other household names, there's not a single major retailer, grocery store, or convenience store that doesn't stock at least some of Procter & Gamble's products.

When the economy is down, consumers cut back on discretionary purchases, but they are much more hesitant to cut back on baby care, feminine care, home care, personal healthcare, and the like. That makes Procter & Gamble the classic example of a defensive stock and the reason you should buy and hold it for the long term.

You may not see outsized gains from its stock price, but its dividend is as reliable as it gets. The company has paid dividends for 132 years and has earned the classification as a Dividend King for increasing its dividend annually for at least 50 consecutive years (66 years in P&G's case). At current prices, Procter & Gamble may be too good to pass up.

3. American Express

When solely looking at its merchant network, American Express (AXP 0.62%) trails behind industry leaders Visa and Mastercard, but that shouldn't make the financial company any less attractive to investors. In its 2022 third quarter, American Express brought in over $13.5 billion in revenue, up 24% year over year, mostly driven by increased spending from its cardholders.

What separates American Express from Visa and Mastercard is that the two competitors don't actually issue their credit cards; their partner banks do. They just process the transactions. American Express both processes transactions and issues its own credit cards, providing it with multiple revenue streams: transaction fees, loan interest, and annual card membership fees.

What's most promising about American Express right now is the relatively young age of consumers it's attracting. Of the 3.3 million new cardholders it added in the third quarter, millennials and Gen Z customers accounted for more than 60%. They're the company's fastest-growing demographic and will be the driving force behind its future growth.

AXP PE Ratio Chart.

DATA BY YCharts.

At its current price levels, American Express appears undervalued. Its price-to-earnings (P/E) ratio -- which tells you how much you're paying for every $1 of a company's earnings -- is well below its competitors. That makes it an even more attractive long-term buy-and-hold stock.