The "Magnificent Seven" group of stocks has been a great cohort to own over the past year, and many are still great buys now. But there are only two that I'd consider no-brainer buys, as the rest may be slightly expensive or face various headwinds.

The two that are no-brainer picks right now are Alphabet (GOOG 9.96%) (GOOGL 10.22%) and Amazon (AMZN 3.43%). For a number of company-specific reasons, each one has the potential to crush the market in the latter half of 2024 and beyond.

Alphabet

Most of what you hear about Alphabet in the news lately is how it's struggling in the AI race. First, it was beat to the punch when integrating generative AI into a search engine. Then its ChatGPT competitor, Bard (now known as Gemini), answered a question incorrectly during its launch event. Recently, Gemini's image-creation feature created inaccurate images that didn't portray what it was asked for.

As a result of these and other issues, Alphabet's stock has no momentum. In fact, it trades for less than 20 times forward earnings, a discount to the S&P 500, which trades around 23 times.

GOOGL PE Ratio Chart

GOOGL PE Ratio data by YCharts.

This undervaluation sits at the base of the investment thesis for buying the stock now. Alphabet is too large and powerful not to figure out generative AI technology. Plus, Gemini is just an ancillary product; it isn't what keeps the lights on at Alphabet.

Right now, 76% of Alphabet's revenue is derived from advertising. It also has a growing cloud computing division, which provided 11% of revenue in Q4, but grew at a 26% pace year over year.

These two divisions are doing well, and their strengths don't match up with Alphabet's cheap stock price. Overall, revenue rose 13% in Q4, its operating margin increased 3 percentage points to 27%, and earnings per share rose from $1.05 to $1.64.

If that was the only information you had to make a guess about how Alphabet's stock was doing, you'd likely assume it was performing quite well.

But with less-flattering headlines dominating the conversation, its stock is struggling. Eventually, though, we can expect Alphabet to resolve these issues and succeed, which will cause the stock to move up a healthy amount from its current low valuation.

Alphabet is a classic case of a damaged stock, not a damaged company.

Amazon

Investors are starting to get a taste of the new Amazon investment thesis. Under founder Jeff Bezos, the tech giant was all about growth. Under successor CEO Andy Jassy, it's about responsible growth and efficiency.

Over the past year, Amazon's margins rose dramatically thanks to a focus on service-based products and various efficiencies realized across the business.

AMZN Gross Profit Margin (Quarterly) Chart

AMZN Gross Profit Margin (Quarterly) data by YCharts.

These improvements caused Amazon's cash flows to skyrocket, producing a quarterly company-record free cash flow of $28 billion in Q4.

Investors can expect continual margin improvement throughout 2024, as Jassy thinks Amazon can surpass operating margin levels set in 2018 for its e-commerce business. In 2018, Amazon posted an operating margin of 5.1% in its North American business. In 2023, that figure was 4.2%.

Should Amazon return to that 5.1% operating margin level, its companywide operating profits would rise by 8.4%. This is without any revenue growth or the fact that Jassy believes it can exceed 2018 levels.

Amazon is a transformed business, and investors have yet to see what a fully profitable and efficient Amazon looks like. We'll get a better picture with each quarter in 2024, but I want to own the stock to take part in its rise.