Calculates sum, average, minimum and maximum.