The comparatively weaker U.S. dollar for the third quarter of 2023 had the effect of increasing sales by approximately $9.8, relative to the comparable period in 2022. The comparatively stronger U.S. dollar for the first nine months of 2023 had the effect of decreasing sales by approximately $81.0, relative to the comparable period in 2022.
Selling, general and administrative expenses were $381.6, or 11.9% of net sales, and $1,095.7, or 11.9% of net sales, for the third quarter and first nine months of 2023, respectively, compared to $366.9, or 11.1% of net sales, and $1,059.0, or 11.3% of net sales, for the third quarter and first nine months of 2022, respectively. The increases in selling, general and administrative expenses as a percentage of net sales in the third quarter and first nine months of 2023 were primarily driven by lower sales during both periods of 2023, relative to the comparable periods of 2022. Administrative expenses represented approximately 4.9% and 4.8% of net sales for the third quarter and first nine months of 2023, respectively, and represented approximately 4.5% and 4.6% of net sales for the third quarter and first nine months of 2022, respectively. Research and development expenses represented approximately 2.7% of net sales for both the third quarter and first nine months of 2023, and represented approximately 2.6% of net sales for both the third quarter and first nine months of 2022. Selling and marketing expenses represented approximately 4.3% of net sales for both the third quarter and first nine months of 2023, and represented approximately 4.1% of net sales for both the third quarter and first nine months of 2022.
Operating income was $657.9, or 20.6% of net sales, and $1,869.6, or 20.3% of net sales, for the third quarter and first nine months of 2023, respectively, compared to $681.1, or 20.7% of net sales, and $1,919.7, or 20.5% of net sales, for the third quarter and first nine months of 2022, respectively. Operating income for the third quarter of 2023 includes $9.0 of acquisition-related expenses (presented separately in the Condensed Consolidated Statements of Income), comprised of external transaction costs related to acquisitions. Operating income for the first nine months of 2023 includes $18.4 of acquisition-related expenses (presented separately in the Condensed Consolidated Statements of Income), comprised of external transaction costs incurred in the second and third quarters of 2023, as well as the amortization related to the value associated with acquired backlog resulting from the acquisition that closed in the first quarter of 2023. Operating income for both the third quarter and first nine months of 2022 includes $12.0 of acquisition-related expenses (presented separately in the Condensed Consolidated Statements of Income), comprised primarily of external transaction costs as well as the amortization related to the value associated with acquired backlog resulting from an acquisition that closed in 2022. For the three and nine months ended September 30, 2023, the acquisition-related expenses had the effect of decreasing net income by $8.4, or $0.01 per share, and $16.2, or $0.03 per share, respectively. For both the three and nine months ended September 30, 2022, the acquisition-related expenses had the effect of decreasing net income by $10.5, or $0.02 per share. Excluding the effect of these acquisition-related expenses, Adjusted Operating Income and Adjusted Operating Margin, as defined in the “Non-GAAP Financial Measures” section below, were $666.9, or 20.8% of net sales, and $693.1, or 21.0% of net sales, for the three months ended September 30, 2023 and 2022, respectively. Adjusted Operating Income and Adjusted Operating Margin were $1,888.0, or 20.5% of net sales, and $1,931.7, or 20.6% of net sales, for the nine months ended September 30, 2023 and 2022, respectively. The slight decreases in Adjusted Operating Income and Adjusted Operating Margin for the third quarter and first nine months of 2023 relative to the comparable periods in 2022 were primarily driven by normal operating leverage on the lower sales volumes, along with the negative impact on operating margin related to acquisitions that are currently operating below the average operating margin of the Company, all partially offset by the benefit of pricing actions.
Operating income for the Harsh Environment Solutions segment for the third quarter and first nine months of 2023 was $239.1, or 26.9% of net sales, and $705.7, or 26.8% of net sales, respectively, compared to $207.1, or 26.1% of net sales, and $596.8, or 25.8% of net sales, for the third quarter and first nine months of 2022, respectively. The increases in operating margin for the Harsh Environment Solutions segment for both the third quarter and first nine months of 2023 relative to the comparable periods in 2022 were primarily driven by normal operating leverage on the higher sales volumes combined with the benefit of pricing actions, partially offset by the negative impact on operating margin related to acquisitions that are currently operating below the average operating margin of the Company.