Quartiles are used to calculate the interquartile range, which is a measure of variability around the median.