David M. Denton
Executive Vice President and Chief Financial Officer at Lowe's Companies
Thanks, Joe. And I'll begin this morning with a few comments on the company's strong capital allocation program. In the second quarter, we generated $2 billion in free cash flow, driven by continued strong operational execution and consumer demand. We returned $3.6 billion to our shareholders through a combination of both dividends and share repurchases. During the quarter, we paid $430 million in dividends at $0.60 per share and we announced a 33% dividend increase to $0.80 per share for the dividend paid on August 4th. Additionally, we repurchased 16.4 million shares for $3.1 billion and we have $13.6 billion remaining on our share repurchase authorization.
Capital expenditures totaled $385 million in the quarter as we invest in the business to support our strategic growth initiatives. We ended the quarter with $4.8 billion in cash and cash equivalents on the balance sheet, which remains extremely healthy. At quarter end, adjusted debt-to-EBITDA stands at 2.08 times, well below our long-term stated target of 2.75 times.
With that, now I'd like to turn to the income statement. In Q2, we generated diluted earnings per share of $4.25, an increase of 13% compared to adjusted diluted earnings per share last year. During the quarter, we drove improved operating leverage as we executed against numerous productivity initiatives across the company. My comments from this point forward will include approximations and comparisons to certain non-GAAP measures where applicable. Q2 sales were $27.6 billion with a comparable sales decline of 1.6%. Comparable average ticket increased 11.3%, driven by over 400 basis points of commodity inflation, mostly in lumber, as well as higher sales of appliances and installations. This was offset by comp transaction count declining 12.9% due to lower sales to DIY customers of smaller ticket items like cleaning products, paint, Mocha and live goods.
In Q2, we cycled over a period when consumer mobility was limited, so many of our customers we're tackling smaller projects around their homes. Also in Q2 of this year, DIY customers pulled back on purchasing lumber and related attachments due to extremely elevated lumber prices in the quarter. Keep in mind that comp transactions increased 22.6% last year, which results in a two-year comp transaction count increase of 6.8%. As Marvin indicated, our investments in our Total Home strategy gave us the ability to pivot during the quarter and led to outperformance in many of our key growth areas, with Pro up 21%, online up 7%, Installation Services up 10%, and strong positive comps across DIY decor categories.
U.S. comp sales were down 2.2% in the quarter, but up 32% on a two-year basis. Our U.S. monthly comps were negative 6.4% in May, negative 1.8% in June, and a positive 2.6% in July. After Memorial Day, there was a noticeable increase in consumer mobility and consumers engaged in the opportunity to travel and spend in other discretionary categories. We saw our related decline in DIY customer traffic in our stores on the weekends, while weekday traffic remained strong.
Looking at U.S. comp growth on a two-year basis from 2019 to '21, May sales increased 32.5%, June increased 32%, and July increased 31.5%. Gross margin was 33.8%. As expected, gross margin rate declined 30 basis points from last year, but was up 165 basis points as compared to Q2 of '19. Product margin rate improved 40 basis points. Our teams effectively managed product cost and pricing this quarter despite unprecedented volatility in lumber prices. Our teams continue to minimize vendor cost increases driven by higher commodity prices and elevated industry transportation costs. Also higher credit revenue drove 30 basis points of benefit to gross margin this quarter. These benefits were offset by 20 basis points of pressure from shrink and live good damages from the extreme weather conditions in the west. Also 25 basis points of mix pressure related to lumber and 20 basis points from less favorable product mix and other categories. Supply chain costs also pressured margin by 35 basis points as we absorbed some elevated distribution costs and continue to expand our omnichannel capabilities. Our supply chain team continues to leverage our scale and carrier relationships to minimize the impact of these distribution cost experienced across the retail industry.
Now I'd like to spend just a moment discussing the near-term impact from the steep drop in lumber prices beginning in early July. Since that time, we've been selling many of our lumber products at compressed margins because we had previously purchased these products at higher cost. However, we expect that by the end of August we will have substantially sold through these higher cost inventory layers and despite these short-term pressures, we are still expecting that our gross margin rate to be up slightly for the full year versus last year.
SG&A at 17% of sales levered a 135 basis points versus LY, driven primarily by lower COVID-related costs. We incurred $25 million of COVID-related expenses in the quarter as compared to $430 million of COVID-related expenses last year. The $405 million reduction in these expenses generated a 145 basis points of SG&A leverage. These benefits were offset by 20 basis points of pressure from higher overall employee health care costs. Operating profit was $4.2 billion, an increase of 6% over LY. Operating margins of 15.3% of sales for the quarter was up 80 basis points to the prior year. This improvement was generated by improved SG&A leverage, partially offset by lower gross margin. The effective tax rate was 24.4% and it was in line with prior year.
At the end of the quarter, inventory was $17.3 billion, down $1.1 billion from Q1 and in line with seasonal trends. This reflects an increase of $3.5 billion from Q2 of 2020 when our in-stock positions were pressured due to elevated demand levels and COVID-related supply disruption. Current inventory includes a year-over-year increase of $665 million related to inflation, the majority of which is attributable to lumber.
Now before I close, let me comment on our current trends and how we are planning the business for the second half of this year. Clearly, we continue to manage our business in a very fluid environment with the Delta variant trends injecting new uncertainty into the forecast. However, given our strong first half performance, Lowe's is clearly tracking well ahead of our robust market scenario that we shared with investors back in December of 2020. Our outlook assumes that the home improvement market will moderate somewhat in the second half given lower levels of commodity inflation and a continued increase in consumer mobility driven by return to work and school. We are expecting Lowe's mix adjusted market demand to be essentially flat for the full year. This relevant market view reflects Lowe's higher DIY mix and lower online penetration.
Now in this revised scenario, we expect Lowe's to deliver sales of approximately $92 billion for the year, representing two-year comparable sales growth of approximately 30%. Month-to-date, August U.S. comp sales trends are materially consistent with July's performance levels on a two-year comparable basis. As expected, we are already seeing a several hundred basis point improvement in comp transaction count over the Q2 levels, partially driven by increased unit sales of DIY lumber and related attachments, as DIY customers who were sitting on the sidelines reengaged after lumber prices dropped.
Importantly, we expect gross margin rate to be up slightly versus the prior year as we leverage our pricing and promotional strategies to mitigate the impacts of product and transportation cost inflation. With elevated sales levels projected and our current productivity efforts taking hold, we are now raising our outlook for operating income margin to 12.2% for the full year. We are expecting a 10 basis point negative impact from elevated cost inflation. Furthermore, we are tracking well ahead of our operating plans. And as such, we now expect to incur higher than planned incentive compensation resulting in 20 basis points of pressure. Together, these expenses represent 30 basis points of operating margin deleverage relative to the $92 billion revenue outlook. Without these off-setting expenses, we will be expecting an operating income margin of 12.5% for the full year.
When I consider outlook for the business for the remainder of this year, I'm very pleased that we are now expected to deliver approximately 145 basis points of operating margin improvement over 2020. This reflects a disciplined focus on driving productivity and operational excellence across the organization. We are planning for capital expenditures of $2 billion for the year. Furthermore, we expect to execute a minimum of $9 billion in share repurchases. In closing, we are operating in a great sector expected to benefit from the secular tailwinds over the next several years. We are investing in the business and our Total Home strategy to drive long-term growth so that we continue to outperform the market and drive meaningful long-term shareholder value.
With that, we are now ready for questions.