Arrange the data in ascending order. Divide the data set into quartiles. The first quartile (Q1) is the median of the lower half, and the third quartile (Q3) is the median of the upper half. Subtract Q1 from Q3: IQR = Q3 - Q1.
For example, if the ages of patients in a study are 20, 22, 23, 24, 25, 26, 28, 30, 32, and 35, the IQR would be calculated as follows: