How are earnings calculated for 401(k) excess contribution distributions?

For 401(k) excess contribution corrections, only earnings attributable to the excess during the calendar year the contribution was made are included in the corrective distribution. Earnings generated between the end of that year and the distribution date (the "gap period") are generally not included in the corrective distribution but remain in the account.