864. Where a person ceases at any time in a taxation year to be a beneficiary under a profit sharing plan and does not again become a beneficiary under the plan after that time and in the year, the person may deduct in computing his income for the year the amount determined by the formula
A − B − (C / 4) − D.
For the purposes of the formula in the first paragraph,(a) A is the aggregate of all amounts each of which is an amount included in computing the person’s income for the year or a preceding taxation year, other than an amount received before that time under the plan or an amount under the plan that the person is entitled at that time to receive, because of an allocation, other than an allocation to which section 860 applies, to the person made contingently under the plan before that time;
(b) B is the portion of the amount that is included in the aggregate determined under subparagraph a because of the second paragraph of section 497;
(c) C is the aggregate of all taxable dividends deemed to be received by the person because of an allocation under section 863 in respect of the plan; and
(d) D is the aggregate of all amounts deductible under this section in computing the person’s income for a preceding taxation year because the person ceased to be a beneficiary under the plan in a preceding taxation year.