Consumer staples stocks are good defensive plays for market downturns, since customers will keep buying products like packaged food, toilet paper, and cigarettes regardless of the country's economic health. So with the S&P 500 flirting with all-time highs, it might be time for investors to check out a few "undervalued" consumer staples stocks.

To spot cheap stocks in this sector, investors should look for P/E ratios below the industry average, two or more consecutive quarters of positive earnings growth, and decent dividends and buybacks. Two big companies fit that bill -- snack maker Mondelez International (MDLZ -1.23%) and tobacco giant Reynolds American (RAI).

Mondelez International

Mondelez owns a wide variety of well-known snack brands like Oreo, Ritz, Chips Ahoy, Cadbury, and Philadelphia cream cheese. Like many big multinational companies, Mondelez's recent growth has been throttled by a strong dollar and macro problems in overseas markets.

Image source: Pixabay via Lindsay Fox, Ecigarettereviewed.com

On a reported basis, Mondelez's revenue fell 17% annually to $6.5 billion and declined across all geographic regions last quarter. But on an organic basis, which excludes the impact of currency fluctuations and acquisitions, sales improved 2% and rose across all regions. This means that if the dollar weakens, Mondelez's reported results would improve substantially. Mondelez's adjusted earnings, which were boosted by $1.2 billion in buybacks during the quarter, rose 31% on a constant-currency basis.

For the full year, Mondelez hopes to achieve "at least" 2% organic sales growth and double-digit earnings growth on a constant-currency basis. But Mondelez also faces fierce pressure from activist investors to do better. Trian Fund Management's Nelson Peltz is pushing Mondelez to pivot away from candy and junk food. Pershing Square's Bill Ackman wants Mondelez to reduce its number of products and adopt new marketing strategies.

Mondelez's stock trades at just 10 times earnings, a considerable discount to the average P/E of 18 for the snack foods industry. Its forward yield of 1.5% might seem paltry, but it spends more money on buybacks. Over the past 12 months, Mondelez has spent $1 billion on dividends and $3.3 billion on buybacks.

Reynolds American

Reynolds American is the second-largest domestic tobacco company after Altria (MO -0.24%). It acquired Lorillard, the third-largest player, for $25 billion last year, which gave it control of nearly 35% of the U.S. cigarette market. Its top brands include Camel, Newport, Pall Mall, and Natural American Spirit. It also owns Vuse, the top e-cigarette brand in America, along with various brands of snuff, snus (moist powder tobacco), and nicotine gum.

Image source: Pixabay.

Smoking rates have been declining in the U.S. for decades, but Reynolds offsets lower cigarette shipments by raising prices, cutting costs, and using big buybacks to bolster its earnings per share. Its expansion into e-cigs and other non-cigarette products diversifies its top line, and the purchase of Lorillard allows it to use economies of scale to reduce redundancies and lower production costs.

The addition of Lorillard's portfolio boosted Reynolds' revenue 42% annually to $2.9 billion last quarter. Adjusted earnings, which exclude gains from the sale of Natural American Spirit's overseas business to Japan Tobacco, rose 16%. Analysts expect Reynolds' revenue to rise 19% for the full year before normalizing to about 5% growth in 2017. Earnings are expected to rise 19% this year and 12% next year.

Reynolds currently trades at 11 times earnings (which excludes the full impact of Lorillard) and 19 times forward earnings (which includes Lorillard), but both ratios are lower than Altria's trailing P/E of 23 and the industry average of 24 for the tobacco industry. Reynolds pays a forward yield of 3.3%, but it also favors buybacks over dividends -- it spent $4.5 billion on buybacks and $1.7 billion on dividends over the past 12 months.

Should you buy either stock?

Mondelez and Reynolds aren't exciting stocks which will lift off anytime soon. But both consumer staples stocks are trading at discounts to their industries, posting decent earnings growth, and returning capital to shareholders via dividends and buybacks. Therefore, investors who want cheap defensive plays to offset some volatility in their portfolios should take a closer look at both stocks.