E = A - A(X ÷ C - R)
Where:
E = The amount excluded from the decedent's gross estate under section 2039(e),
A = The value of the qualifying annuity at the decedent's death (as determined under §§ 20.2031-1 and 20.2031-7 or, for certain prior periods, § 20.2031-7A ),
X = The amount which is an excess contribution at the decedent's death (as determined under section 4973(b)),
C = The total amount contributed by or on behalf of the decedent to the individual retirement plan, and
R = The total of amounts paid or distributed from the individual retirement plan before the death of the decedent which were either includable in the gross income of the recipient under section 408(d)(1) and represented the payment or distribution of an excess contribution, or were payments or distributions described in section 408(d)(4) or (5) (relating to returned excess contributions).
26 C.F.R. §20.2039-5