What happened

Reversing course from the 6.7% slide they suffered in June, shares of W.W. Grainger (GWW 0.27%) soared in July. While the S&P 500 climbed 9.1%, shares of Grainger, a supplier of maintenance, repair, and operating products, blasted 19.6% higher last month, according to data from S&P Global Market Intelligence

Some credit for the stock's rise can be attributed to the overall bullish sentiment that raced through the market last month, but the primary catalyst was the enthusiasm investors exhibited in response to the company's second-quarter 2022 earnings report.

So what

Beating analysts' estimates on both the top and bottom lines, Grainger delighted investors when it reported Q2 2022 earnings on July 29. The market was so impressed, in fact, that the stock closed 8.3% higher on the day of the report than on the previous day. While analysts had expected the company to report revenue of $3.7 billion and earnings per share of $6.65, Grainger reported sales and EPS of $3.8 billion and $7.19, respectively.

Grainger reported 20% sales growth quarter over quarter, and it succeeded in expanding its gross profit margin 255 basis points and operating margin 350 basis points during the same period. These feats, in turn, helped the company achieve an impressive 68% quarter-over-quarter increase in EPS.

Besides looking at the previous quarter's performance, management addressed 2022 guidance in its earnings report, raising it from the initial forecast. Whereas Grainger had originally expected to book sales of approximately $14.7 billion, it now projects 2022 sales of about $15.1 billion. Similarly, management updated EPS guidance as well, raising it to about $28 from $26. Lest investors think management neglected the company's cash flow in the revised guidance, Grainger raised that forecast as well. Initially, management projected operating cash flow of $1.25 billion; now, however, it foresees generating $1.3 billion in cash from operations.

Now what

While discussion of an economic downturn has many investors worried, Grainger doesn't seem so concerned. Raising its 2022 sales, EPS, and cash flow guidance, management appears optimistic that the coming months will be ones of growth for the company -- and it's not as if that growth is attributable to any one industry that Grainger serves. During its Q2 2022 earnings presentation, management forecast sales growth from customers in a variety of industries, including transportation, natural resources, healthcare, and retail, just to name a few.

The company's impressive performance last quarter and increased optimism regarding the remainder of the year bode well for investors. For those worried about an economic slide, moreover, Grainger may be a stock to consider as a conservative approach to fortifying one's portfolio.