The stock market's performance in 2022 was awful all around. While the initial plunge in early 2022 was led by speculative growth stocks, few areas of the stock market have been spared.

With that in mind, there are some excellent opportunities for long-term investors to pick up shares of value stocks at extremely attractive valuations. Here are two in particular that look like compelling buys right now.

1. A mega-bank at a discount

Bank of America (BAC -0.38%) has underperformed the overall stock market in the recent downturn, with shares 35% below their 52-week high. And there are some legitimate reasons. Most significantly, there's a possible recession looming, which can cause loan delinquencies to spike higher and can cause demand for new loans to collapse.

However, there are some benefits that come with the current economic environment that investors may be overlooking. The bank has a high proportion of noninterest-bearing deposits and a generally low-cost overall deposit base, which makes it a big beneficiary of rising interest rates. As benchmark rates (and lending rates) rise, so do Bank of America's profits. In fact, Bank of America's net interest income grew by $2.7 billion year-over-year in the third quarter, and management estimates it could rise by another $4.2 billion annually for every 100-basis-point rise in rates.

Bank of America is also doing a great job of building out its technology platform and has improved its asset quality dramatically over the past decade or so. With the bank's stock trading for a historically low valuation of less than 1.1 times book value and 9 times forward earnings, Bank of America looks like a bargain for long-term investors.

2. This REIT has plunged on overblown fears

Real estate investment trust (REIT) EPR Properties (EPR 0.82%) actually outperformed the market for most of the 2022 downturn. However, when its second-largest tenant (Regal Entertainment) prepared to declare bankruptcy in late summer, it made investors nervous. Now the stock is about 30% below the highs and has an 8.2% dividend yield.

To put it mildly, the plunge in EPR's stock price feels overdone. EPR leases 57 theaters to Regal, and these are generally high-quality theaters (meaning theaters Regal wants to keep open). The operator paid rent on all of its EPR leases in October and November, and rent obligations generally have to still be paid while a tenant is in bankruptcy if they want to continue to occupy the premises.

In addition, EPR has a strong balance sheet with $161 million in cash and an untapped $1 billion credit line. Plus, while the dividend yield is high, it is well covered by EPR's profits. In fact, the current dividend represents just 72% of the company's 2022 funds from operations (the REIT equivalent of earnings) estimate, and that factors in the uncertainty of the Regal situation.

Buy for the long term

Let's be clear. I think these are two great stocks to buy as we head into 2023, but I have absolutely no idea what their stock prices will do during 2023. While I don't necessarily have a gloomy outlook for the new year, if a recession comes or if inflation surges again, these stocks aren't likely to shoot higher in the near term. However, these are two well-run businesses with a lot of potential, and I'm confident investors who buy at these levels will be glad they did.