Formula to calculate the months of a year with Start Date + End Date

Lets say you have 2 columns Start Date+End Date for a contract duration and you want to calculate the months for each year. Any idea how the formula should look like?
I need the amount of months for each year in a separat column.
to calculate 2023 I was able to use this formula:
IF(YEAR({Start Date})=2023,12-MONTH({Start Date})+1,0)

Monday-months

Hi Peter,

Try

MONTH({End Date})-MONTH({Start Date})+1+(Year({End Date})-Year({Start Date}))*12

What if we could break free of the Formula column? and write formulas that update any type of columns? What if a formula could update multiple columns at once? This is possible with the Advanced Formula Booster app.

Hi Gilles, formula working - but that returns only the total amount of months - what I need is a break down to years - meaning that I need the amount of months for 2023, 2024, 2025 … depending on the 2 fields start date / end date.
Lets say you have start date: 01.02.2023 + end date 30.06.2025 then the result should be:
column 2023: 11 / column 2024: 12 / column 2025: 6

regards Peter