In a dataset or frequency distribution, the median is a measure of central tendency, that is, it is a value about which the data is approximately evenly distributed. The median is calculated by sorting the data from lowest to highest and taking the middle value if there are an odd number of data values, and taking the average of the middle two values if there are an even number of values. The median is less affected than the mean by the presence of large outliers in the data, or by data that is strongly skewed.