The COVID-19 outbreak caused major disruption for some industries while causing a spike in demand for everyday essentials. (AMZN -0.34%) and PepsiCo (PEP -0.59%) both saw a boost in sales for certain products. Amazon saw a surge in demand for groceries, while sales of wireless products and other non-essentials were dampened during the outbreak. 

PepsiCo generated 54% of its sales last year from food with the balance from beverages, and it experienced balanced growth across these categories in the first quarter. In addition to its namesake soft drink brand, it owns Gatorade, Mountain Dew, Quaker, Doritos, and SodaStream, the fast-growing, do-it-yourself soda maker that it acquired in 2018 for $3.3 billion. 

Year to date, Amazon stock has climbed 64% as investors sense a step change in customer migration to shopping online, which remains a key part of the investment thesis for Amazon. PepsiCo's solid first quarter wasn't enough to boost the stock, which is down slightly since the start of the year.

Here's a review of each company's recent performance and valuation analysis.

A computer keyboard with a delivery truck pictured on one key.

Image source: Getty Images.

Amazon gets swamped with online ordering

Amazon is certainly the better growth stock between the two. Even with some categories like apparel and electronics experiencing lower demand during the COVID-19 outbreak, total revenue still grew 26% year over year in the first quarter. It's impressive to see Amazon still able to deliver this much growth, particularly as CFO Brian Olsavsky explained on the conference call that the large demand spike for essential categories "created major challenges" in Amazon's operations network as well as for third-party merchants and suppliers. 

Amazon hired 175,000 new employees to meet the "unprecedented demand" for grocery items, home office supplies, and health and personal care items. While this helped Amazon meet the demand and deliver healthy sales growth for the quarter, it could have an impact on Amazon's performance later in the year, as Olsavsky explained: "While we generally have experience in getting ready for spikes in demand for known events like the holiday season and Prime Day, we also generally spend months ramping up for these periods." 

Amazon also said it will spend $4 billion in COVID-related costs in the second quarter, which is more than the $4 billion generated in operating income in the first quarter. 

Looking out over the long term, Amazon is not just about retail. It's dominant in cloud computing with Amazon Web Services (AWS), which posted robust sales growth of 33% year over year in the last quarter. Operating income growth was even more stellar at 38%. AWS reported $3 billion in operating profit, which comprised about three quarters of Amazon's total operating profit in the quarter. 

When you buy a share of Amazon, you're investing in a fast-growing cloud stock as much as a growing e-commerce giant. Both markets provide ample growth opportunities long term, as more businesses shift from on-premise servers to the cloud, and given that total e-commerce sales still represent a small percentage of overall retail sales worldwide. 

Recent investments are paying off for Pepsi

The snack food empire is performing well after CEO Ramon Laguarta stepped in a few years ago to improve performance. Management has made investments in marketing, manufacturing capacity, and innovation, and all these efforts have paid off.

PepsiCo delivered 7.9% organic revenue growth, which excludes currency changes and the impact from acquisitions and divestitures. That reflects higher demand from COVID-19 toward the end of March and a significant improvement over the year-ago quarter's 5.2% organic revenue growth. The bottom-line performance was also strong, with core constant currency earnings-per-share (EPS) up 10%. 

PepsiCo was already performing well before the spike in demand. Management disclosed that excluding the demand surge around COVID-19, organic revenue would have still exceeded 5% growth in the quarter. Equally impressive was that growth was broad-based across geographies, and balanced across snacks and beverages. 

PepsiCo is making important investments in other areas, such as e-commerce, which totaled $2 billion in sales in 2019, representing about 3% of total revenue. It's also making investments in data analytics to better understand the consumer, and management sees a long growth runway in international markets.

Which stock is the better buy?

Obviously, if you're looking for growth, Amazon is worthy of consideration. Amazon stock has returned more in the last three years (up 209%) than PepsiCo stock has over the last 10 years with dividends reinvested (186%). 

But isn't Amazon a bit pricey? Based on traditional measures of value like price-to-earnings (P/E), PepsiCo might look like the better deal. Amazon looks frothy at a forward P/E of 150, which makes PepsiCo's forward P/E of 25 look like a bargain. PepsiCo also offers an above-average dividend yield of 2.9%, although the cash payout ratio is currently at 107%, which doesn't leave much room to increase the dividend if free cash flow doesn't grow. 

But the following chart puts Amazon's valuation in a different light. It shows Amazon's stock price relative to the amount of cash it generates from operations on a per-share basis.

PEP Price to CFO Per Share (TTM) Chart

PEP Price to CFO Per Share (TTM) data by YCharts

With Amazon's P/CFO spiking from 24 to over 38 in recent months, this may not be the best entry point to buy the stock. It might not be a bad idea to buy the consumer staples giant now and wait to buy Amazon later.

But for growth investors itching to hop on the Amazon freight train, I wouldn't be afraid to start a position in the stock now. Although its richly valued now, a P/CFO ratio of 38 is within Amazon's historical trading range. An investor who buys shares today with the goal to gradually add more shares over time should end up with a greater return in Amazon than PepsiCo, given Amazon's much faster rate of revenue growth. From that perspective, I would call Amazon the better buy.