. During the 2022 third quarter, our capital expenditures were $41.6 million primarily at Trex Residential related to cost reduction initiatives, the new Arkansas manufacturing facility, capacity expansion in our existing facilities, our new corporate headquarters, and safety, environmental and general support.
Repurchase of common shares
. We repurchased 1.7 million shares of our outstanding common stock in the 2022 third quarter under our Stock Repurchase Program for a total 9.0 million shares repurchased under the program as of September 30, 2022.
Our results of operations are affected by a number of factors, including, but not limited to, the cost to manufacture and distribute products, cost of raw materials, inflation, interest rates, consumer spending and preferences, the impact of any supply chain disruptions, economic conditions, and any adverse effects from the
COVID-19
pandemic and geopolitical conflicts.
Strong sales growth in the first and second quarters of 2022 reflected an increase in Trex Residential net sales driven by pricing actions taken in 2021 and 2022, volume growth that continued to reflect strong secular trends in the outdoor living category, continued execution of our
market strategy share conversion, and channel inventory build to support historically high growth rates. The channel inventory build was due in part to expected consumer demand along the lines of what was seen in 2020 and 2021, but also was a consequence of improved product availability following more than two years of capacity constraints and product allocations.
However, towards the end of June Trex Residential experienced a reduction in demand from its distribution partners, spurred by concerns over a potential easing in consumer demand due to rising interest rates, declining consumer sentiment and expectations of a general slowing in the economy. As a result, beginning in the third quarter Trex Residential’s channel partners met demand partially through inventory drawdown. The drawdown negatively impacted third quarter sales and will impact fourth quarter sales. In response to this changed environment, Trex Residential immediately took measures to manage a production slowdown, including labor force reductions, production optimization, as well as other cost actions.
. Net sales consist of sales and freight, net of discounts. The level of net sales is principally affected by sales volume and the prices paid for Trex products. Trex Residential operating results have historically varied from quarter to quarter. Seasonal, erratic or prolonged adverse weather conditions in certain geographic regions reduce the level of home and commercial improvement and residential and commercial construction and can shift demand for our products to a later period. As part of our normal business practice and consistent with industry practice, we have historically provided our distributors and dealers of our Trex Residential products incentives to build inventory levels before the start of the prime deck-building season to ensure adequate availability of our product to meet anticipated seasonal consumer demand and to enable production planning. These incentives include payment discounts, favorable payment terms, price discounts, or volume rebates on specified products and other incentives based on increases in purchases as part of specific promotional programs. The timing of our incentive programs can significantly impact sales, receivables and inventory levels during the offering period. In addition, the operating results for Trex Commercial are driven by the timing of individual projects, which may vary each quarterly period.
Gross profit represents the difference between net sales and cost of sales. Cost of sales consists of raw material costs, direct labor costs, manufacturing costs, subcontract costs and freight. Raw material costs generally include the costs to purchase and transport reclaimed wood fiber, reclaimed polyethylene, pigmentation for coloring our products, and commodities used in the production of railing and staging. Direct labor costs include wages and benefits of personnel engaged in the manufacturing process. Manufacturing costs consist of costs of depreciation, utilities, maintenance supplies and repairs, indirect labor, including wages and benefits, and warehouse and equipment rental activities.
Selling, General and Administrative Expenses.
The largest component of selling, general and administrative expenses is personnel related costs, which includes salaries, commissions, incentive compensation, and benefits of personnel engaged in sales and marketing, accounting, information technology, corporate operations, research and development, and other business functions. Another component of selling, general and administrative expenses is branding and other sales and marketing costs, which are used to build brand awareness. These costs consist primarily of advertising, merchandising, and other promotional costs. Other general and administrative expenses include professional fees, office occupancy costs attributable to the business functions previously referenced, and consumer relations expenses. As a percentage of net sales, selling, general and administrative expenses may vary from quarter to quarter due, in part, to the seasonality of our business.
Below is the discussion and analysis of our operating results and material changes in our operating results for the three months ended September 30, 2022 (2022 quarter) compared to the three months ended September 30, 2021 (2021 quarter), and for the nine months ended September 30, 2022 (2022 nine-month period) compared to the nine months ended September 30, 2021 (2021 nine-month period).