I am looking to be able to count the dates in a month between a campaign start and end date that crosses years so that I can project the monthly spend amounts. I am close in that I created monthly columns and am using this formula to count the days within the flights in each month:
IFERROR(IF(AND(MONTH([Flight Start]@row) < 1, MONTH([Flight End]@row) = 1), DAY([Flight End]@row), IF(AND(MONTH([Flight Start]@row) = 1, MONTH([Flight End]@row) = 1), DAY([Flight End]@row) - DAY([Flight Start]@row), IF(AND(MONTH([Flight Start]@row) < 1, MONTH([Flight End]@row) > 1), 31, IF(AND(MONTH([Flight Start]@row) = 1, MONTH([Flight End]@row) > 1), 31 - DAY([Flight Start]@row), "")))), "")
The issue is that it only works within the calendar year and I have flights that cross years. You can see in the example below that row 3 is giving the same result for January as row 2.
Any help appreciated!