Calculating the mean
Mean = (x₁ + x₂ + … + xₙ) / n. Add all values and divide by how many there are. For [4, 8, 15, 16, 23, 42], the sum is 108 and the count is 6, so the mean is 108 / 6 = 18.
The mean is sensitive to every value in the dataset. Adding one very large or very small value pulls the mean significantly. This is why the mean is sometimes called a non-robust statistic. For skewed distributions or data with outliers, the median is often a better measure of the "typical" value.