Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Average Calculator (Mean)

Enter the numbers you want to average, separated by commas (,). Along with the average (arithmetic mean), the sum, count, median, geometric mean, maximum, minimum and range are calculated too.

Enter 2 or more numbers separated by commas (,), for example 10, 2, 38. Decimals and negative numbers are OK.
Result
Enter your numbers separated by commas in the field on the left and press "Calculate". The result will appear here.

What you can do on this page

  • Enter numbers separated by commas (,) and you get the average (arithmetic mean) \(\bar{x}\) on the spot
  • Questions like "What is the average of the test scores 82, 76, 90, 65, 88?" are answered in one step
  • The sum, count, median, geometric mean, maximum, minimum and range are calculated at the same time
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
This page calculates the ordinary average (arithmetic mean), which gives every value the same weight. It cannot be used for an average where values have different weights (a weighted average). The geometric mean can only be calculated when all the numbers are greater than 0.

What is this calculation used for?

Finding your average test score (school)

If your scores on five tests are 82, 76, 90, 65 and 88, your average is \((82+76+90+65+88) \div 5 = 401 \div 5 = 80.2\) points.
Tracking your average over the semester or comparing it with the class average, the mean is the most familiar way to sum up your grades in one number.

Finding a monthly average to set a budget (money)

If your electric bills for three months are $84, $72 and $99, the monthly average is \(255 \div 3 = 85\) dollars.
Spending that changes from month to month becomes a budget number, "about this much every month", once you take the average. The "monthly average" in budgeting apps is this same calculation.

Using the median so the "average" does not mislead you (reading statistics)

Suppose five households have savings of $10,000, $20,000, $30,000, $40,000 and $400,000. The mean is $100,000, but the median is only $30,000.
A few large values pull the mean up, so for lopsided data such as savings or income, the mean and the median are often far apart. When a news report says "the average is X dollars", checking the median too helps you compare it with real life.

Climate "normals", the averages behind weather forecasts (weather)

When a forecast says a day is "warmer than normal", the "normal" is based on the average of 30 years of observations (in the US, NOAA updates these Climate Normals every 10 years).
The very standard for judging whether today's temperature is ordinary is a long-term average. It is an everyday use of the mean that society relies on.

Using the geometric mean for average growth rates (business and investing)

If sales grew to 1.21 times in 2 years, the growth per year is found not by adding and dividing but with the geometric mean, \(\sqrt{1.21} = 1.1\) (1.1 times per year, or 10% growth per year).
For amounts that build up by multiplication, such as investment returns and sales growth, use the geometric mean. This is standard practice in business.

Formula

Average (arithmetic mean)
Standard notation (the usual math form)
\(\bar{x}\) \(=\) \((x_1 + x_2 + \cdots + x_n)\) \(\div\) \(n\)
In words (symbols replaced with words)
③ \(\bar{x}\): mean \(=\) ① sum of the data \(\div\) ② \(n\): number of values
The formula in words
① Take the sum of the data
② divide it by the \(n\): number of values
③ and you get the \(\bar{x}\): mean
Quick example
The average of five quiz scores out of 10, which are 8, 6, 9, 7 and 10, is
\(\bar{x}\): mean \(=\) sum (8 + 6 + 9 + 7 + 10 = 40) \(\div\) count (5 quizzes)
\((8 + 6 + 9 + 7 + 10) \div 5 = 40 \div 5 = 8\)
Key idea
The mean tells you how much each person would get if the total were shared out equally. You can also think of it as the value you get when you level out uneven data. Be careful: the mean is pulled strongly by extremely large (or small) values, called outliers. For example, if 5 people have $0, $0, $0, $0 and $10,000, the mean is $2,000, but you cannot say that "everyone has about $2,000". When the data may be lopsided, it helps to look at the median (next formula) as well.
Median
Standard notation (the usual math form)
\(\tilde{x}\) \(=\) \(x_{\left(\,(n+1)/2\,\right)}\)
\(\tilde{x}\) \(=\) \(\left( x_{(n/2)} + x_{(n/2+1)} \right)\) \(\div\) \(2\)
In words (symbols replaced with words)
② \(\tilde{x}\): median (odd number of values) \(=\) ① the middle value after sorting from smallest to largest
⑤ \(\tilde{x}\): median (even number of values) \(=\) ③ sum of the two middle values \(\div\) ④ \(2\)
The formula in words
① Sort the data from smallest to largest. When there is an odd number of values, the value exactly in the middle
② is the \(\tilde{x}\): median
③ When there is an even number of values, there are two middle values. Take the sum of the two middle values
④ divide it by \(2\) (this is the mean of the two middle values)
⑤ and you get the \(\tilde{x}\): median
Quick example
For the data 3, 5, 8, 10 (an even number of values, 4), the median is the mean of the two middle values (5 and 8), so
\(\tilde{x}\): median \(=\) sum of the two middle values (5 + 8 = 13) \(\div\) 2
\((5 + 8) \div 2 = 13 \div 2 = 6.5\)
Key idea
In the formula, \(x_{(k)}\) means "the \(k\)th value when the data is sorted from smallest to largest" (for example, \(x_{(1)}\) is the minimum). The median is the middle by rank, so its strength is that extremely large or small values (outliers) hardly affect it. When the mean and the median are far apart, it is a sign that the data is being pulled by a few large (or small) values.
Geometric mean
Standard notation (the usual math form)
\(G\) \(=\) \(\left( x_1 \times x_2 \times \cdots \times x_n \right)\) \(1/n\)
In words (symbols replaced with words)
③ \(G\): geometric mean \(=\) ① product of all the data (everything multiplied together) ② to the power \(\dfrac{1}{n}\) (the \(n\)th root)
The formula in words
① Take the product of all the data multiplied together
② raise it to the power \(\dfrac{1}{n}\) (the \(n\)th root: the number that gives the product when multiplied by itself \(n\) times)
③ and you get the \(G\): geometric mean
Quick example
The geometric mean of 2 and 8 is the square root of their product 16 (the number that gives 16 when squared), so
\(G\): geometric mean \(=\) product of the two (2 × 8 = 16) to the power \(\dfrac{1}{2}\) (square root)
\(G = \sqrt{2 \times 8} = \sqrt{16} = 4\)
Key idea
The geometric mean is used to average amounts that build up by multiplication. For example, if your savings grew to 1.21 times in 2 years, the growth per year is \(\sqrt{1.21} = 1.1\) (1.1 times per year on average). The key is to multiply and take a root, not to add and divide as in the ordinary mean. The geometric mean is only defined when all the numbers are greater than 0. It cannot be used for data that includes 0 or negative numbers, so this calculator does not show it in that case.
Range
Standard notation (the usual math form)
\(R\) \(=\) \(x_{\max}\) \(-\) \(x_{\min}\)
In words (symbols replaced with words)
③ \(R\): range \(=\) ① \(x_{\max}\): maximum \(-\) ② \(x_{\min}\): minimum
The formula in words
① Take the maximum (the largest value)
② subtract the minimum (the smallest value)
③ and you get the \(R\): range
Quick example
For the data 10, 2, 38, 23, 38, 23, 21, the range is the maximum 38 minus the minimum 2, so
\(R\): range \(=\) maximum (38) \(-\) minimum (2)
\(38 - 2 = 36\)
Key idea
The range is the quickest way to see how widely the data is spread out. But it only looks at two values, the maximum and the minimum, so a single outlier can change it a lot. To measure the spread more accurately, the standard deviation and similar measures are used.
The average (arithmetic mean) is basically "sum ÷ count". Look at the median as well when the data may have outliers, and use the geometric mean for amounts that build up by multiplication (growth rates, ratios). Choosing the right one makes it easier to see what the data really says.

Symbols and terms

Symbols

\(x_1, x_2, \ldots, x_n\) x sub 1, x sub 2, …, x sub n The individual values you want to average. (Example - the test scores of 5 students)
\(n\) n The number of values. (Example - for 5 students, \(n = 5\))
\(\bar{x}\) x-bar The mean (arithmetic mean). A bar over the letter is the standard way to write a mean in statistics.
\(\tilde{x}\) x-tilde The median. Textbooks often just write the word "median" instead of a symbol, and some write it as M or Med.
\(x_{(k)}\) x sub k in parentheses The \(k\)th value when the data is sorted from smallest to largest. (Example - \(x_{(1)}\) is the minimum)
\(G\) G The geometric mean, from the first letter of "geometric".
\(R\) R The range, the maximum minus the minimum. It comes from the first letter of "range".

Terms

arithmetic mean The ordinary "average". Add up all the data and divide by the number of values. When people just say "average" or "mean", this is usually what they mean.
measure of center A single number that sums up where the data is centered. The three main ones are the mean, the median and the mode. In US schools they are usually taught in Grade 6.
median The value exactly in the middle when the data is sorted from smallest to largest. With an even number of values, take the mean of the two middle values. It is a measure of center that outliers hardly affect.
mode The value that appears most often in the data. It is one of the measures of center, along with the mean and the median (the calculator on this page does not cover it).
geometric mean The average found by multiplying all the data together and taking the \(n\)th root. It is used to average amounts that build up by multiplication, such as growth rates and ratios. It is only defined when all the numbers are greater than 0.
range The maximum minus the minimum. It is the quickest measure of how spread out the data is.
outlier A value that is extremely far from the other values. The mean is pulled strongly by outliers, but the median is hardly affected.
weighted average An average where each value gets its own "weight". It is used, for example, when a grade counts the midterm exam as 40% and the final exam as 60% (the calculator on this page gives all values the same weight).

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.

Addition and division (Grades 3–4)
  • Being able to add three or more numbers one after another
  • Knowing that division means splitting into equal shares
The mean (Grade 6)
  • Knowing that the mean shows the value you get when uneven amounts are leveled out
  • Knowing that mean = sum ÷ count
Division with decimal answers (Grade 5)
  • Being able to do divisions that come out to a decimal, such as \(13 \div 2 = 6.5\), not just ones like \(40 \div 5 = 8\)
Statistics and measures of center (Grade 6)
  • Being able to sort data from smallest to largest
  • Knowing what the three measures of center (mean, median and mode) mean and how they differ
Square roots (Grade 8) [for the geometric mean]
  • Knowing a square root as "the number that gives this number when squared", as in \(\sqrt{16} = 4\)

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the average (arithmetic mean)
Value 1 10
Value 2 2
Value 3 38
Value 4 23
Value 5 38
Value 6 23
Value 7 21
Sum =SUM(B1:B7)
Count =COUNT(B1:B7)
Average (arithmetic mean) =AVERAGE(B1:B7)
Table to find the median
Value 1 10
Value 2 2
Value 3 38
Value 4 23
Value 5 38
Value 6 23
Value 7 21
Median =MEDIAN(B1:B7)
Table to find the geometric mean
Value 1 10
Value 2 2
Value 3 38
Value 4 23
Value 5 38
Value 6 23
Value 7 21
Geometric mean =GEOMEAN(B1:B7)
Table to find the range (max − min)
Value 1 10
Value 2 2
Value 3 38
Value 4 23
Value 5 38
Value 6 23
Value 7 21
Maximum =MAX(B1:B7)
Minimum =MIN(B1:B7)
Range (max − min) =B8-B9
After pasting, B1 to B7 are the cells for your numbers, and the cells in bold green are calculated automatically.
In the first table, B8 shows the sum 155, B9 shows the count 7, and B10 shows the average, about 22.14.
To use a different number of values, add (or remove) rows of numbers, then change "B1:B7" in the formulas to your actual data range (for 10 values, B1:B10).
The geometric mean (GEOMEAN) gives an error if the data includes a number that is 0 or less.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the average (arithmetic mean)
Value 1 10
Value 2 2
Value 3 38
Value 4 23
Value 5 38
Value 6 23
Value 7 21
Sum =SUM(B1:B7)
Count =COUNT(B1:B7)
Average (arithmetic mean) =AVERAGE(B1:B7)
Table to find the median
Value 1 10
Value 2 2
Value 3 38
Value 4 23
Value 5 38
Value 6 23
Value 7 21
Median =MEDIAN(B1:B7)
Table to find the geometric mean
Value 1 10
Value 2 2
Value 3 38
Value 4 23
Value 5 38
Value 6 23
Value 7 21
Geometric mean =GEOMEAN(B1:B7)
Table to find the range (max − min)
Value 1 10
Value 2 2
Value 3 38
Value 4 23
Value 5 38
Value 6 23
Value 7 21
Maximum =MAX(B1:B7)
Minimum =MIN(B1:B7)
Range (max − min) =B8-B9
The same functions as in Excel (AVERAGE, MEDIAN, GEOMEAN, MAX, MIN) work as is. Copy the whole table, paste it into cell A1, and replace B1 to B7 with your own numbers.

How to calculate it in Python

import statistics

numbers = [10, 2, 38, 23, 38, 23, 21]  # the numbers to average

average = statistics.mean(numbers)                    # average (arithmetic mean)
median = statistics.median(numbers)                   # median
geometric_mean = statistics.geometric_mean(numbers)   # geometric mean (only when all numbers are positive)
largest = max(numbers)                                # maximum
smallest = min(numbers)                               # minimum
value_range = largest - smallest                      # range

print(f"Average: {average}")
print(f"Sum: {sum(numbers)} / Count: {len(numbers)}")
print(f"Median: {median}")
print(f"Geometric mean: {geometric_mean}")
print(f"Maximum: {largest} / Minimum: {smallest} / Range: {value_range}")
Runs with the standard library only (the statistics module). Replace the numbers list at the top with your own numbers and run it. The geometric mean (geometric_mean) is available in Python 3.8 and later, but it raises an error for data that includes 0 or negative numbers, so delete the geometric mean lines in that case.

How to write it in LaTeX and other math languages (copy and paste)

Average (arithmetic mean)
x̄ = (x₁ + x₂ + ⋯ + xₙ) ÷ n
\bar{x} = \frac{x_1 + x_2 + \cdots + x_n}{n}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mover accent="true"><mi>x</mi><mo>&#x00AF;</mo></mover>
    <mo>=</mo>
    <mfrac>
      <mrow>
        <msub><mi>x</mi><mn>1</mn></msub>
        <mo>+</mo>
        <msub><mi>x</mi><mn>2</mn></msub>
        <mo>+</mo>
        <mo>&#x22EF;</mo>
        <mo>+</mo>
        <msub><mi>x</mi><mi>n</mi></msub>
      </mrow>
      <mi>n</mi>
    </mfrac>
  </mrow>
</math>
bar x = (x_1 + x_2 + cdots + x_n) / n
Mean[{x1, x2, x3}]
xbar := add(x[i], i = 1 .. n)/n;
xbar = mean(x);
x̄ = (x_1 + x_2 + ⋯ + x_n)/n
Median
\tilde{x} = \begin{cases} x_{(\,(n+1)/2\,)} & (n:\ \mathrm{odd}) \\[6pt] \dfrac{x_{(n/2)} + x_{(n/2+1)}}{2} & (n:\ \mathrm{even}) \end{cases}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mover accent="true"><mi>x</mi><mo>&#x7E;</mo></mover>
    <mo>=</mo>
    <mrow>
      <mo>{</mo>
      <mtable columnalign="center left">
        <mtr>
          <mtd><msub><mi>x</mi><mrow><mo>(</mo><mo>(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo>)</mo><mo>/</mo><mn>2</mn><mo>)</mo></mrow></msub></mtd>
          <mtd><mrow><mo>(</mo><mi>n</mi><mo>:</mo><mtext>odd</mtext><mo>)</mo></mrow></mtd>
        </mtr>
        <mtr>
          <mtd><mfrac>
            <mrow>
              <msub><mi>x</mi><mrow><mo>(</mo><mi>n</mi><mo>/</mo><mn>2</mn><mo>)</mo></mrow></msub>
              <mo>+</mo>
              <msub><mi>x</mi><mrow><mo>(</mo><mi>n</mi><mo>/</mo><mn>2</mn><mo>+</mo><mn>1</mn><mo>)</mo></mrow></msub>
            </mrow>
            <mn>2</mn>
          </mfrac></mtd>
          <mtd><mrow><mo>(</mo><mi>n</mi><mo>:</mo><mtext>even</mtext><mo>)</mo></mrow></mtd>
        </mtr>
      </mtable>
    </mrow>
  </mrow>
</math>
tilde x = {(x_(((n+1)/2)), if n odd), ((x_(n/2) + x_(n/2+1))/2, if n even):}
Median[{x1, x2, x3}]
Statistics:-Median([x1, x2, x3]);
med = median(x);
x̃ = (x_(n/2) + x_(n/2+1))/2 (for an even number of values; for an odd number, x̃ = x_((n+1)/2))
Geometric mean
G = (x₁ × x₂ × ⋯ × xₙ)^(1/n)
G = \left( x_1 x_2 \cdots x_n \right)^{1/n}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>G</mi>
    <mo>=</mo>
    <msup>
      <mrow>
        <mo>(</mo>
        <msub><mi>x</mi><mn>1</mn></msub>
        <msub><mi>x</mi><mn>2</mn></msub>
        <mo>&#x22EF;</mo>
        <msub><mi>x</mi><mi>n</mi></msub>
        <mo>)</mo>
      </mrow>
      <mrow><mn>1</mn><mo>/</mo><mi>n</mi></mrow>
    </msup>
  </mrow>
</math>
G = (x_1 x_2 cdots x_n)^(1/n)
GeometricMean[{x1, x2, x3}]
G := (x1 * x2 * x3)^(1/3);
G = prod(x)^(1/numel(x));
G = (x_1 x_2 ⋯ x_n)^(1/n)
Range
R = xₘₐₓ − xₘᵢₙ
R = x_{\max} - x_{\min}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>R</mi>
    <mo>=</mo>
    <msub><mi>x</mi><mi>max</mi></msub>
    <mo>&#x2212;</mo>
    <msub><mi>x</mi><mi>min</mi></msub>
  </mrow>
</math>
R = x_(max) - x_(min)
Max[{x1, x2, x3}] - Min[{x1, x2, x3}]
R := max(L) - min(L);
R = max(x) - min(x);
R = x_max − x_min

How to have ChatGPT  do the calculation

You are a statistics calculation assistant. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

For the following data, find each of the values below.
Data: 10, 2, 38, 23, 38, 23, 21
1. The average (arithmetic mean)
2. The sum and the count
3. The median
4. The geometric mean
5. The maximum, the minimum and the range (maximum − minimum)

Show the formulas you used and the numbers from the execution result.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.