It's hard to ignore the eye-catching headlines about the 12-month 7.5% consumer price index (CPI) rise from January 2021. The dollar just isn't going as far as it used to, and people across the U.S. are feeling the pain. With most bank accounts earning next to nothing on interest, there are few places investors can go to protect their savings.

For people who have extra cash that isn't needed to pay off debts or be used in the short-term, the stock market may be able to provide meaningful returns despite the current economic conditions. Two companies whose stocks have great upside potential are Alphabet (GOOG -0.38%) (GOOGL -0.46%) and The Trade Desk (TTD 2.59%). The market has sold both off recently, providing a prime buying opportunity for these two stocks.

A person wearing a suit stares at a large $1 bill with a descending arrow on it.

Image source: Getty Images.

1. Alphabet

Warren Buffett's key to investing during inflationary times is finding businesses that can flex their pricing power. Often these companies have a premium, or best-in-class, product business that consumers are willing to pay up for. For example, two of Alphabet's divisions, the Google search engine and YouTube have massive market dominance. With an 86% search engine and 76% online video platform market share, according to Statista and Datanyze, Alphabet's platforms offer advertisers a premium product because of the number of eyes they attract.

During the fourth quarter, Google search grew its revenue from $31.9 billion to $43.3 billion, resulting in a 36% growth rate year on year. YouTube is much smaller but still grew sales at a 25% clip to $8.6 billion. Advertising spending was impacted significantly during 2020 as businesses cut their advertising budgets to cope with pandemic-related expenses. With advertisement spending roaring back in 2021, 2022 will provide difficult comparisons. However, if Alphabet flexes its pricing power, it could continue growing at a similar, ludicrous rate for how sizable Alphabet's revenue streams are.

Additionally, Alphabet is highly profitable. Throughout 2021, Alphabet's operating margin was 31% and produced earnings per share (EPS) of $112.20 with free cash flow (FCF) of $67 billion. The stock is affordably priced when assessed using a price-to-free cash flow ratio.

GOOG Price to Free Cash Flow Chart
Data by YCharts.

With Alphabet's valuation approaching a level last reached during the COVID-19 sell-off in March 2020, as well as significant profitability and strong revenue, Alphabet is a strong pick for a stock that can both beat the market and curb inflation's effect over the next three to five years.

2. The Trade Desk

Another advertisement play with a premium product, The Trade Desk provides a demand-side platform allowing companies to buy advertisement space on connected TV, podcasts, and websites. Additionally, with Alphabet's decision to eliminate tracking cookies, The Trade Desk's Unified ID 2.0 (UID2) solution is being adopted by companies as a cookie replacement. It maintains user data that makes targeted advertising valuable while respecting consumer privacy -- a win-win for everyone involved.

Similar to Alphabet, The Trade Desk benefited from an advertisement boost during 2021, with revenue growing 43% to $1.17 billion for the whole year. The Trade Desk is a much younger company than Alphabet, founded in 2009. As a result, it is still expanding its reach and establishing itself. Most companies like The Trade Desk are unprofitable, yet CEO and founder Jeff Green has emphasized profits from the beginning. For the full year, The Trade Desk's net income margin was 29% -- almost the same as Alphabet's.

Since investors perceive The Trade Desk as having a long growth runway, it's valued significantly higher than Alphabet at 112 times FCF. A lot of this optimism is derived from UID2 and recently inked deals. During the fourth quarter of 2021, The Trade Desk's partnership with Walmart kicked off in connecting businesses with consumers by advertising specific products that can be purchased on Walmart's website or in-store. 

Three people sit on a couch and look at a television.

Image source: Getty Images.

In the fourth-quarter earnings call, Green highlighted the success of Société Bic, better recognized as Bic, as a testimony to the usefulness of the co-developed platform. Bic, known for making lighters and pencils, achieved a return on advertisement spend (ROAS) of 500%, meaning every dollar spent on advertising resulted in $5 of sales. For reference, Nielsen sets the bar at 270% for a good ROAS. With The Trade Desk's analysis tools, Bic was able to determine how the advertising translated into increased sales.

With Alphabet and The Trade Desk down 15% and 34% from their all-time highs, respectively, the stocks are most likely on sale. Both businesses have a premium product which means they can likely raise their prices to drive profits. With the purchasing power of the dollar decreasing, advertising will only become more intense as businesses are competing for a smaller share of consumer dollars. With the right time horizon (three to five years), each stock has a great opportunity to outperform the market and beat inflation.