What happened

Clorox (NYSE:CLX) shares made a dramatic comeback in June, ending the month 11.9% higher according to data provided by S&P Global Market Intelligence and reversing a major chunk of the losses they'd piled on year to date.

Interestingly, Clorox shares have been on the rise ever since the company reported its third-quarter earnings early May despite a full-year earnings downgrade. What gives?

So what

Rising cost pressure has been a common theme across the consumer goods industry. Clorox's third-quarter gross margin dropped to 42.8% from 44% as a result. Yet, the company earned 5% higher net profit year over year on lower taxes and 3% growth in sales. More importantly, Clorox upgraded its full-year sales guidance to the higher end of its previous range of 1%-3%. On the flip side, it downgraded its fiscal 2018 earnings per share (EPS) outlook to $6.15-$6.30 from $6.17-$6.37. There's nothing to worry here, though.

Clorox's products and brands.

Image source: Clorox Company.

In March, Clorox announced plans to acquire health and wellness company, Nutranext for $700 million, to be financed through cash and debt. While Clorox expects the acquisition to add a percentage point to its top line this year (hence the revenue outlook upgrade), acquisition-related expenses are expected to dilute its earnings.

Investors were encouraged by Clorox's resilience amid challenging cost conditions. To top that, the company announced a share repurchase program worth $2 billion later in May, reflecting management's confidence in its long-term goals, which include 3%-5% growth in annual sales and conversion of 11%-13% annual revenue into free cash flows.

Rising cash flows should also mean higher dividends for shareholders: Clorox has already made a mark in the dividend world as a Dividend Aristocrat and rewarded shareholders with a good 14% increase in dividends earlier this year.

So what

Clorox's full-year outlook, after the downgrade, calls for a solid 16% growth in EPS at the midpoint. While the Nutranext acquisition is unlikely to be accretive before fiscal 2020, Clorox should still be able to grow its EPS at a decent clip next year. The growth potential in earnings and dividend, coupled with the buyback program, was good enough for the market to propel Clorox shares higher last month.

Neha Chamaria has no position in any of the stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.