I think your syntax is wrong. iif should be IIF(<expresstion to evaluate>,<then expression>,<else expression>) and safedivide takes
safedivide(<numerator>,<denominator>,<if denom 0 return expression>). So you have
SafeDivide(IIF
(Year([HEADER_RR.ORIGONPLANDT])>=...