I am currently working on a report where I want to show the months between a date and the end of 2018. Current formula is this
I want to add in another element to say if the initial date is on or before the 15th of the month it will round down if it is 16th and after it will round up the month.
I’m struggling to add that part in. thanks in advance for your help.
There is a date in H4. Currently you have something equitable to,
=IF(YEAR($H4)=2018, 13-MONTH($H4), 12)
Append this modifier to the formula,
=IF(YEAR($H4)=2018, 13-MONTH($H4)-(DAY($H4)>15), 12)
For those dates within 2018, the months to year end are one less for dates after the 15th.
From how I’m reading your question: You want the 15th of February to return
2 (“February”), but the 16th of February to return
The first ‘level’ of this would simply be to change
Now, there’s 2 potential issues here: First, do you want 12th January to return
12, and Second – do you want 25th December to return
(From your existing formula, I am assuming that you want
13 for late-December to get “0 months remaining this year”, but that would probably mean that any date in January should be returning
1 – otherwise you get “13 months remaining this year”)
So, running the bracketed assumptions above:
And plug it into your formula.
(IF(YEAR($H4)=2018, 13-MIN(MONTH($H4), 1+MONTH($H4-15)), 12))