It was a problem with the leap year.
(I am not 100% sure on how exactly this works, but here's my thought process to solve this)
Specifically, if the year input is a leap year, you have to account for the difference by subtracting one day.
if(format-date(${Ex8},'%Y') mod 4 = 0, date(decimal-date-time(${Ex8}) + ((365.25*18)- 1)), date(decimal-date-time(${Ex8}) + ((365.25*18))))
Formula explanation: if the input year is evenly divisible by 4, subtract one day for a leap year, otherwise add as normal.
This yields the following for December 1, 2020, and for November 1, 1979, as
You'll notice that for leap years, the 20th and 40th anniversaries are showing up incorrectly. That is (as best I can tell), because those years are evenly divisible by four also.
To fix this, just use your original formula for those fields.
date(decimal-date-time(${Geb_Datum}) + (365.25*20))
To summarize, the following should help you:
Type | Name | Label | Calculation |
date | Ex8 | Example 8 | |
date | Ann18Fix | 18th Anniversary Fixed | if(format-date(${Ex8},'%Y') mod 4 = 0, date(decimal-date-time(${Ex8}) + ((365.25*18)- 1)), date(decimal-date-time(${Ex8}) + ((365.25*18)))) |
date | Ann20Fix | 20th Anniversary Fixed | date(decimal-date-time(${Ex8}) + (365.25*20)) |
date | Ann30Fix | 30th Anniversary Fixed | if(format-date(${Ex8},'%Y') mod 4 = 0, date(decimal-date-time(${Ex8}) + ((365.25*30)- 1)), date(decimal-date-time(${Ex8}) + ((365.25*30)))) |
date | Ann40Fix | 40th Anniversary Fixed | date(decimal-date-time(${Ex8}) + (365.25*40)) |
Hope this helps!