Gross profit decreased $0.6 million, or 1.1%, for the second quarter of fiscal 2022 compared to the second quarter of fiscal 2021. Gross profit margin, as a percentage of net sales, decreased to 20.6% for the second quarter of fiscal 2022 from 22.6% for the second quarter of fiscal 2021. The decreases in gross profit and gross profit margin were mainly attributable to manufacturing scheduling inefficiencies due to the current supply chain issues, and inflationary cost increases including labor, freight and manufacturing supplies, which were largely offset by increased sales volume.
In the year-to-date comparison, gross profit increased $11.9 million, and gross profit margin increased to 21.7% for the first two quarters of fiscal 2022 from 20.8% for the first two quarters of fiscal 2021. The increases in gross profit and gross profit margin were primarily attributable to lower commodity acquisition costs for all major tree nuts except cashews and increased sales volume, which were partially offset by the manufacturing inefficiencies and inflationary cost increases noted above in the quarterly comparison.
Total operating expenses increased $9.0 million, and total operating expenses, as a percentage of net sales, increased to 13.4% from 10.7% in the quarterly comparison. The increase in operating expenses resulted mainly from an approximately $3.0 million increase in advertising, consumer insight research and related consulting expenses as we continue to reinvent and reinvigorate our brands. An increase in freight expense of approximately $1.9 million and an increase in payroll and a payroll-related expenses of approximately $0.5 million also contributed to the increase in total operating expenses. The prior year’s second quarter also included an insurance settlement gain of $2.3 million that did not reoccur in the current quarter.
Total operating expenses for the first two quarters of fiscal 2022 increased $13.0 million, and total operating expenses, as a percentage of net sales, increased to 12.2% from 10.2%. The increase in total operating expenses was mainly due to the same reasons cited in the quarterly comparison. The insurance settlement gain that occurred in the second quarter of the prior year was offset by the gain from the sale of our Garysburg, North Carolina facility that occurred in the first quarter of the current fiscal year.
Interest expense for the current second quarter increased slightly as compared to the second quarter of fiscal 2021 due to higher average short-term debt levels. For the first two quarters of fiscal 2022, interest expense decreased slightly due to a reduction in our weighted average interest rate.
The total value of inventories on hand at the end of the second quarter of fiscal 2022 increased 15.0% compared to the total value of inventories on hand at the end of the second quarter of fiscal 2021 due to higher commodity acquisition costs for almost all tree nuts, peanuts, dried fruit and other raw materials, which were partially offset by lower on hand quantities of inshell pecans and cashews. The weighted average cost per pound of raw nut and dried fruit input stocks on hand at the end of the second quarter of fiscal 2022 increased 24.4% compared to the weighted average cost per pound at the end of the second quarter of fiscal 2021. The increase in the weighted average cost per pound of raw nut and dried fruit input stocks was attributable to higher commodity acquisition costs for almost all input stock items, which was offset in part by lower on hand quantities of inshell pecans and cashews.
“I am pleased to report that we continue to deliver strong net sales and volume growth in this unprecedented operating environment. We reported sales volume growth for a majority of our brands, in all our distribution channels and in our e-commerce initiatives. In addition, our commercial ingredients and contract packaging channels continue to recover from the impact of COVID-19 as sales volume in these channels has approached pre-pandemic levels. However, inefficiencies from supply chain issues, higher than anticipated inflationary input costs and labor shortages had a negative impact on our profitability as they outpaced our pricing actions in respect to timing. All our pricing actions are expected to be fully
3