Many investors may feel like they've missed the boat this year. In a brutal 2022, when the Nasdaq Composite fell more than 30%, investors may have been spooked into heavier bond allocations in their portfolios (and less allocation toward stocks). Though a move like that may have felt wise at the time, it's likely led to massive market underperformance this year as the Nasdaq Composite has risen 34% year to date.

And investors who bailed out of stocks may be frustrated about the prices they have to pay to get back in the game. Many tech giants' stocks, for instance, have soared. Case in point: Alphabet (GOOG 0.32%) (GOOGL 0.37%) shares have risen 54% year to date. But that doesn't mean it's too late to invest. The Google parent company is a good example of one stock that is still attractive -- even after a jaw-dropping year-to-date return.

Valuing Alphabet stock

The case for why Alphabet stock is fundamentally undervalued is pretty straightforward. The stock currently trades at just 22 times analysts' average estimate for the stock's earnings over the next 12 months. This is only a slight premium to the S&P 500's forward price-to-earnings ratio of 20, even though Alphabet boasts a lucrative business model, is a clear market leader in online search, has strong top- and bottom-line growth prospects, and benefits from one of the best balance sheets in the S&P 500 index. Alphabet boasts $118 billion in cash, cash equivalents, and short-term investments versus just $12 billion in long-term debt.

To appreciate why a forward price-to-earnings ratio of 22 is low for Alphabet, consider that the average Wall Street analyst forecast for the tech company's annual compound growth rate in earnings per share over the next five years is an impressive 16%. A high-quality company like Alphabet, with earnings growth potential like this, easily deserves a forward price-to-earnings multiple in the mid-to-high twenties.

Investors should watch the stock closely

Of course, there are some serious risks to the bull case for Alphabet. Namely, the company has been under antitrust pressure recently. Indeed, the Justice Department sued Google earlier this year for allegedly "monopolizing multiple digital advertising technology products." 

Further, an uncertain macroeconomic environment has weighed heavily on the company's advertising revenue growth rates. Alphabet's advertising revenue rose just 3% year over year in Q2.

Investors should watch both of these issues to see how they play out. If Alphabet can't adjust its business model to appease the Justice Department, there could be risks to the company's long-term growth potential. Further, Alphabet's advertising revenue growth rates will need to reaccelerate as the economy recovers for the stock to live up to its valuation. Fortunately, Alphabet's fast-growing cloud business is helping pick up some slack. But the tech company will eventually need its core advertising business to perform well, too.

In the meantime, these risks seem largely priced into the stock's valuation. If anything, shares are likely trading at a discount to their fair value.