Gross profit
Gross profit for the year ended December 31, 2023, was $35.8 million, a decrease of $105.1 million, or 74.6%, compared to the year ended December 31, 2022. The decrease was primarily attributable to activity related to the M&P business line discussed in the Recent Events section and progress toward completions in our Transportation segment.
Gross profit for the year ended December 31, 2022, was $140.9 million, an increase of $26.7 million, or 23.4%, compared to the year ended December 31, 2021. This increase was primarily due to an increase in proportionate volume of higher margin projects led by strong operating results in our Transportation segment and negative project adjustments in 2021 that impacted the period over period increase. Our gross margin percentage was 12.1% for the year ended December 31, 2022, compared to 8.9% for the year ended December 31, 2021.
Selling, general, and administrative costs
Selling, general, and administrative costs for the year ended December 31, 2023, were $67.2 million, an increase of $9.0 million, or 15.4%, compared to the year ended December 31, 2022. The increase was primarily driven by a $5.2 million increase in compensation and additional staffing, $1.9 million increase in public company costs, and a $1.9 million increase in bad debt.
Selling, general, and administrative costs for the year ended December 31, 2022, were $58.2 million, an increase of $0.1 million, or 0.1%, compared to the year ended December 31, 2021. The increase, as a percentage of revenue, for the year ended December 31, 2022, compared to the year ended December 31, 2021, was primarily driven by the costs associated with the merger with Legato Merger Corp. II.
Gain/loss on investments, net
Loss on investments, net for the year ended December 31, 2022, was $0.1 million, a decrease of $1.0 million, or 108%, compared to the year ended December 31, 2021. The decrease was primarily driven by a decrease in our total amount invested within our investment accounts.
Other income, net
Other income, net for the year ended December 31, 2023 was $23.6 million, an increase of $21.4 million, or 969.9%, compared to the year ended December 31, 2022. The increase was primarily driven by a reversal of a non-cash contingent liability due to changes in the likelihood of earnout shares being issued based on 2023 performance.
Other income, net for the year ended December 31, 2022 was $2.2 million, a decrease of $0.6 million, or 20.7%, compared to the year ended December 31, 2021. The decrease was primarily driven by a loss in foreign currency remeasurement due to the decrease in exchange rate in 2022 compared to 2021.
Interest expense
Interest expense for the year ended December 31, 2023, was $19.5 million, an increase of $10.6 million, or 119.0%, compared to the year ended December 31, 2022. The increase is primarily driven by an increase in external borrowings compared to the prior year and higher interest rates on the additional borrowings. We also experienced increased borrowing costs on our revolving credit facility compared to the same period in 2022.
Interest expense for the year ended December 31, 2022, was $8.9 million, an increase of $1.6 million, or 23%, compared to the year ended December 31, 2021. The difference was attributable to increased borrowings and higher interest rates.