The median age is the age that divides the population into two numerically equal groups, the first half being younger and the other half older.
It is calculated from the population by age group.
Each age group is assigned an age which corresponds to the middle of the class.
The age group from which the cumulative population is greater than or equal to the total population divided by 2.
In our example counting 30 inhabitants, the median is in the age group 5-9 years because the cumulative population in the lower age groups does not total 15 inhabitants.
The median age is therefore, according to the age assigned to each age group, 7 years.