The S&P 500 (SNPINDEX: ^GSPC) soared 24% last year as investors piled into the "Magnificent Seven," a group of mega-cap stocks that collectively account for more than one-quarter of the index. All seven more than doubled the S&P 500's return in 2023, but Nvidia, Meta Platforms, and Tesla performed especially well. Their triple-digit gains landed them among the top 10 stocks in the S&P 500.

However, the Magnificent Seven look pricey with a collective valuation of 30 times forward earnings, especially when the broader S&P 500 trades at 20 times forward earnings. Of course, those premium valuations may be justified in several cases, but investors should still consider diversifying in 2024. Roku (ROKU -10.29%) and Shopify (SHOP 1.11%) look attractive at their current valuations, and both stocks are widely accessible at less than $100 per share.

1. Roku

Roku shares jumped 30% following its third-quarter report as investors cheered better-than-expected results. Revenue growth accelerated to 20%, up from 11% in the prior quarter, driven by a rebound in advertising and strong demand for Roku-branded TVs. On the bottom line, the company reported non-GAAP EBITDA of $43 million, up from a loss of $34 million in the prior year. Investors can expect similar momentum in the coming years.

Roku is the leading streaming platform in the U.S., Canada, and Mexico as measured by viewing time. The brand accounted for more than half of connected TV (CTV) devices in North America in Q3, and Roku OS was the top-selling TV operating system in the U.S. and Mexico last year. Those countries are important because they are the only three markets in which Roku has launched its advertising business in full force.

That tells investors Roku can take share in new geographies, which bodes well for shareholders because the company has laid groundwork for expansion into Germany, Australia, and the United Kingdom. Specifically, Roku TV models (featuring Roku OS) are available in Germany and Australia, and The Roku Channel (an ad-supported service) is available in the United Kingdom. Those three countries rank among the top 10 advertising markets in the world.

Here's the bottom line: Roku engages viewers more effectively than other streaming platforms. That makes the company a valuable partner to content publishers and advertisers, which means Roku is well positioned to benefit as streaming become more prevalent and brands spend more on CTV advertising.

Wall Street expects the company to grow sales at 16% annually over the next five years. In that context, its current valuation of 4 times sales looks cheap, especially when the three-year average is 9 times sales. Investors should feel comfortable buying a small position in this growth stock today.

2. Shopify

Shopify shares jumped 22% following a strong third quarter. Revenue increased 25% to $1.7 billion due to pricing power, new merchant additions (especially larger merchants), international expansion, and better merchant monetization through adjacent services.

The company also reported GAAP net income of $718 million, up from a loss of $159 million in the prior year, as the divestiture of its cost-intensive logistics business allowed for significant margin expansion. Investors can expect more of the same in the coming quarters.

Shopify's software lets merchants manage their businesses across physical and digital channels from a single dashboard. That includes online marketplaces like Amazon, social media like TikTok, and direct-to-consumer websites. Shopify supplements its software with adjacent financial services like payment processing and loans. Merchants can also access solutions for wholesale commerce and cross-border commerce.

To quote Shopify President Harley Finkelstein: "No other platform has built for every facet of commerce like Shopify has, whether it's online or in person, [small business] or enterprise, direct-to-consumer or wholesale, domestic or global."

That turnkey strategy has made Shopify popular with businesses of all sizes. Its standard software is the most popular e-commerce platform on the market, and its enterprise-grade software (Shopify Plus) is the leading omnichannel commerce platform, according to research company G2. Shopify powers more than 10% of online retail sales in the U.S., making it the second largest domestic e-commerce company behind Amazon.

Shopify should benefit as retail e-commerce becomes more prevalent, and its ability to monetize merchants should continue to increase as it adds more adjacent services to its portfolio. For instance, Shopify has yet to start charging merchants for Audiences, marketing software that uses machine learning to target advertising across properties like Google Search and YouTube by Alphabet.

Additionally, Shopify has been adding wholesale capabilities to its enterprise-grade software as a means of bringing larger merchants to its ecosystem. That strategy substantially increases its addressable market. The wholesale e-commerce market is three times bigger than the retail e-commerce market, according to Grand View Research.

Wall Street expects Shopify to grow revenue at 22% annually over the next five years. That consensus estimate makes its current valuation of 17 times sales seem reasonable. Investors with a five-year time horizon can buy a few shares of this growth stock with confidence right now.