Okay, let's rework the formula. If I understand you correctly, you are
wanting to calculate the total premium for a single given year, based on the
policy effective date and policy termination date. The Premium date is the
year that you are trying to calculate the premium for. You are trying to
calculate the number of days in the Premium Year, and then use the number of
days of the premium year, divide by 365, then multiply by the Annual premium,
and that is your resultant. That being said, why not use a formula like so:
=(MAX(MIN(TermYear2,DATE(PremYear,12,31)),DATE(PremYear,1,1))-MIN(MAX(EffYear2,DATE(PremYear,1,1)),DATE(PremYear,12,31)))/365*AnnPremium
TermYear2 = actual end date of policy
EffYear2 = actual start date of policy
PremYear = year you are trying to calculate for.
AnnPremium = Annual premium amount.
It first determines the earliest date 12/31 of Prem Year, or Termination
date (the MIN). Then it takes that and calculates which is later, that or 1/1
of Prem Year.
Then it determines the later of 2 dates, the effective date of the policy,
or 1/1 of Prem Year, and compares that to which is earliest, that or 12/31 of
Prem Year.
If TermDate is less than PremYear, both calculations will come up to 1/1 of
prem year. If EffDate is greater than PremYear, both calculations will come
up to 12/31 of prem year. It ill take the first value and subtract the second
value, divide this by 365, and then multiply it by the Annual Premium.
Hope this helps.