Ita Brennan
Chief Financial Officer at Arista Networks
Thanks, Jayshree and good afternoon. This announcement of our Q2 results and our guidance for Q3 '22 is based on non-GAAP and excludes all non-cash stock-based compensation impacts, certain acquisition-related charges and other nonrecurring items. A full reconciliation of our selected GAAP to non-GAAP results is provided in our earnings release.
Total revenues in Q2 were $1.052 billion, up 48.7% year-over-year and well above the upper end of our guidance range of $950 million to $1 billion. Overall, demand in the quarter was healthy with strength across all areas of the business. The supply environment remains challenging with ongoing supplier decommits constraining shipments and requiring higher cost broker purchases and expedite fees. Services and subscription software contributed approximately 17.6% of revenue in the second quarter, down from 19.2% in Q1. This largely reflected accelerated growth in product revenues, while services and software continue to grow on a more consistent basis.
International revenues for the quarter came in at $206.8 million or 20% of total revenue, down from 24% in the first quarter. This reflected strength in U.S. revenues in the period, particularly with our larger cloud titan customers. Overall gross margins in Q2 were 61.9% at the upper end of our guidance range of 60% to 62% with somewhat lower-than-expected expedite fees in the period. As previously discussed, the current lower gross margin ranges reflect a healthy cloud mix and the need for higher levels of broker component sourcing and expedite fees.
Operating expenses for the period were mostly flat to last quarter at $226.1 million or 21.5% of revenue. R&D spending came in at $148 million or 14.1% of revenue, up from last quarter at $144.3 million. This primarily reflected increased headcount costs in the period.
Sales and marketing expense were $63.1 million or 6% of revenue compared to $66.2 million last quarter, with increased headcount offset by lower variable expenses. Our G&A costs came in at $15 million or 1.4% of revenue, consistent with last quarter.
Our operating income for the quarter was $425.5 million or 40.4% of our revenue. Other income and expense for the quarter was a favorable $4.6 million, and our effective tax rate was approximately 20.9%. This resulted in net income for the quarter of $342.7 million or 32.6% of revenue. Our diluted share number was 316.58 million shares, resulting in a diluted earnings per share number for the quarter of $1.08, up approximately 59% from the prior year.
Now turning to the balance sheet. Cash, cash equivalents and investments ended the quarter at approximately $2.9 billion. We repurchased $483.7 million of our common stock during the second quarter at an average price of $101 per share. As a reminder, we've now repurchased approximately $693 million or 6.5 million shares against our October 2021 billion dollar board authorization. The actual timing and amount of future repurchases will be dependent on market and business conditions, business requirements, stock price, acquisition opportunities and other factors. We also completed two acquisitions in the first half with a total consideration of $158.9 million, including $4 million in common stock and the remainder in cash. The revenue and expenses associated with these acquisitions are included in our outlook provided below and are not expected to have a material impact on our financials in the near term.
Now turning to operating cash performance for the second quarter. We generated $101.1 million of cash from operations in the quarter, reflecting strong earnings performance, somewhat offset by increased working capital investments. Increases in inventory and other assets are mainly driven by a receipt of components for future shipments, including shipments delayed due to supplier decommits. This trend should reverse once overall supply conditions for these decommitted components improve.
DSOs came in at 51 days, down from 67 days in Q1, reflecting the linearity of billings and a decline in deferred revenue in the period. Inventory turns were 1.9x, up from 1.7x in the prior quarter. Inventory increased $852.8 million in the quarter, up from $694.2 million in the prior period, reflecting higher component and peripherals inventory and a small increase in switch-related finished goods.
Our purchase commitment number for the quarter was $4.5 billion, up from $4.3 billion in Q1. These multiyear purchase commitments reflect overall strength in demand and the current long lead time supply environment. As a reminder, we continue to prioritize newer early life cycle products for inclusion in these strategies in order to help mitigate the risk of excess or obsolescence.
Our total deferred revenue balance was $1 billion, down from $1.1 billion in Q1. The majority of the deferred revenue balance is services related and directly linked to the timing and term of service contracts, which may vary on a quarter-by-quarter basis. Approximately $228 million of the balance, down from $327 million last quarter, represents product deferred revenue largely related to customer-specific acceptance clauses for new products with our larger customers. Accounts payable days were 63 days, up from 58 days in Q1, reflecting the timing of inventory receipts and payments. Capital expenditures for the quarter were $8.9 million.
Now turning to our outlook for the third quarter and beyond. Our Analyst Day outlook for 2022 call for 30% year-over-year revenue growth, somewhat balanced across our market sectors and heavily constrained by supply. Reflecting on the first half of the year, we achieved revenue growth of approximately 40% in the face of a very difficult supply environment. We had, again, saw the resilience of the business model with higher component costs, combined with a heavier cloud mix, lowering gross margin but allowing for increased scale, operating margin expansion and year-over-year earnings per share growth of approximately 48%.
Looking to the third quarter. While demand metrics have remained strong across the business, attempts to predictably scale shipments have been somewhat hindered by ad hoc supplier decommits. Our Q3 outlook assumes some improvement in ship volume but reflects a balanced view of the remaining supply chain uncertainties. We expect gross margin pressure to continue with some need for broker purchases and expedite fees, combined with a healthy revenue contribution from our cloud titan customers. As to spending and investments, we expect to continue to grow our investments in R&D and sales and marketing, in line with our baseline investment plan. However, we are cognizant of the broader macro risks, and we will continue to monitor spending carefully.
So all of this as a backdrop, our guidance for the third quarter, which is based on non-GAAP results and excludes any non-cash stock-based compensation impacts and other non-recurring items, is as follows: Revenues of approximately $1.025 billion to $1.075 billion, gross margin of approximately 60% to 62%, operating margin of approximately 39%. Our effective tax rate is expected to be approximately 21% and diluted shares on a post-split basis of approximately 316 million shares.
I will now turn the call back to Liz. Liz?