The effect of this section is to provide for the repayment of rent in the situation where a tenancy is brought to an end under section 21 before the end of a period of the tenancy and the tenant has paid rent in advance for this period, during which they will now not be occupying the property for one or more days. The tenant is entitled to repayment of an amount of the rent they have paid to the landlord, calculated in accordance with a formula. The section provides that if the repayment of rent has not been made when the court considers whether to make a possession order under section 21, the court shall order the landlord to pay the amount of rent to which the tenant is entitled.
R is the rent paid for the final period;
D is the number of whole days of the final period for which the tenant was not in occupation of the dwelling-house; and
P is the number of whole days in that period.