Math

Built-in step · 13 steps

Add, average, round, and compare numbers.

Steps

StepWhat it does
Calculate absolute valueGet a number without its minus sign, for example -5 becomes 5.
Calculate averageCalculate the average of a list of numbers.
Calculate totalAdd up all numbers in a list.
Find maximum valueFind the largest number in a list.
Find middle valueFind the middle value of a list of numbers.
Find minimum valueFind the smallest number in a list.
Find most common numberFind the number that appears most often in a list.
Find the standard deviationMeasure how spread out a list of numbers is: close to 0 when they are all alike, larger the more they vary.
Format numberTurn a number into a polished display string with thousands separators, decimal places, and an optional currency symbol or percent sign, for example 1234.5 becomes $1,234.50 and 0.125 becomes 12.50%.
Math functionSquare roots, logarithms, factorials, trigonometry and the other functions a spreadsheet has.
Round numberRound a number up, down, or to the nearest value.
Work out a percent changeFind by what percent a number went up or down, like sales from 80 to 100 is up 25%, and from 100 to 80 is down 20%.
Work out a percentageFind what percent one number is of another, like 25 of 200 is 12.5%: a conversion rate, a share of the total, a progress bar.

Calculate absolute value

Get a number without its minus sign, for example -5 becomes 5.

Inputs

NumbervaluenumberRequired
The number to drop the minus sign from.

Outputs

The number without its minus sign.

Example output
5.25

Calculate average

Calculate the average of a list of numbers.

Inputs

NumbersvalueslistRequired
The list of numbers to average. Text like "12.50" counts as a number, and blank items are skipped.

Outputs

The average of the numbers in the list, or blank if it has none.

Example output
2.5

Calculate total

Add up all numbers in a list.

Inputs

NumbersvalueslistRequired
The list of numbers to add up. Text like "12.50" counts as a number, and blank items are skipped.

Outputs

The sum of the numbers in the list, or 0 if it is empty.

Example output
1234.5

Find maximum value

Find the largest number in a list.

Inputs

NumbersvalueslistRequired
The list of numbers to look through. Text like "12.50" counts as a number, and blank items are skipped.

Outputs

The largest number in the list, or blank if it has none.

Example output
199.99

Find middle value

Find the middle value of a list of numbers. For an even-length list, the two middle values are averaged.

Inputs

NumbersvalueslistRequired
The list of numbers to find the middle of. Text like "12.50" counts as a number, and blank items are skipped.

Outputs

The middle number once the list is sorted, or the average of the two middle numbers when the list has an even count. Blank if the list has no numbers.

Example output
2.5

Find minimum value

Find the smallest number in a list.

Inputs

NumbersvalueslistRequired
The list of numbers to look through. Text like "12.50" counts as a number, and blank items are skipped.

Outputs

The smallest number in the list, or blank if it has none.

Example output
12.5

Find most common number

Find the number that appears most often in a list.

Inputs

NumbersvalueslistRequired
The list of numbers to look through. Text like "12.50" counts as a number, and blank items are skipped.

Outputs

The number that appears most often in the list. In a tie, the one that appears first. Blank if the list has no numbers.

Example output
4.5

Find the standard deviation

Measure how spread out a list of numbers is: close to 0 when they are all alike, larger the more they vary. The same as STDEV in a spreadsheet.

Inputs

NumbersvalueslistRequired
The list of numbers. Text like 12.50 counts, and blanks are skipped.
The numbers arebasistext
A sample of a larger group (STDEV, the usual choice), or the whole group (STDEV.P).One of: sample (A sample), population (The whole group). Default: sample.

Outputs

How far the numbers typically are from their average, or blank when there are too few numbers (a sample needs two).

Example output
2.1380899353

Format number

Turn a number into a polished display string with thousands separators, decimal places, and an optional currency symbol or percent sign, for example 1234.5 becomes $1,234.50 and 0.125 becomes 12.50%.

Inputs

NumbervaluenumberRequired
The number to format.
StylestyletextRequired
How the number is presented: plain, grouped with thousands separators, a currency, a percentage (0.125 is 12.50%), or an ordinal (22 is 22nd).One of: plain (Plain (1234.5)), thousands (Thousands separators (1,234.5)), usd (US Dollars ($)), eur (Euros (€)), gbp (British Pounds (£)), jpy (Japanese Yen (¥)), currency (Another currency), percent (Percent (12.5%)), ordinal (Ordinal (1st, 2nd, 3rd)). Default: plain.
Currencycurrencytext
The currency's three-letter code, like CAD, AUD, CHF or INR. Well-known currencies get their symbol (CA$, ₹); others are written with their code (CHF 1,234.50).Only when Style is Another currency.
Decimal placesdecimalsnumber
How many decimal places to show. Leave blank for the usual places: 2, or 0 for currencies like yen.Only when Style is Plain (1234.5), Thousands separators (1,234.5), US Dollars ($), Euros (€), British Pounds (£), Japanese Yen (¥), Another currency or Percent (12.5%).
Separatorsseparatorstext
How thousands and decimals are written. With a decimal comma, a currency symbol follows the amount (1.234,56 €).One of: comma_period (1,234.56), period_comma (1.234,56), space_comma (1 234,56), apostrophe_period (1'234.56). Default: comma_period.

Outputs

The number as text, with thousands separators, the chosen decimal places, and a currency symbol or percent sign for those styles.

Example output
"$1,234.50"

Math function

Square roots, logarithms, factorials, trigonometry and the other functions a spreadsheet has. For powers, use ** in a formula, like 2 ** 10.

Inputs

NumbervaluenumberRequired
The number to work it out for. Angles are in degrees.
FunctionfunctiontextRequired
What to work out.One of: square_root (Square root), cube_root (Cube root), natural_log (Natural log (ln)), log10 (Log base 10), log (Log to a base), exponential (e to the power of), factorial, truncate (Drop the decimals), sign (Sign (1, 0 or -1)), gcd (Greatest common divisor), and 7 more. Default: square_root.
Second numberothernumber
For a log to a base, the base; for a greatest common divisor or least common multiple, the other number.Only when Function is Log to a base, Greatest common divisor or Least common multiple.

Outputs

The result, as a whole number when it is one.

Example output
12

Round number

Round a number up, down, or to the nearest value.

Inputs

NumbervaluenumberRequired
The number to round.
DirectionmodetextRequired
How to round: to the nearest value (halves away from zero, so 2.5 is 3 and -2.5 is -3), up, or down.One of: nearest, up, down. Default: nearest.
Decimal placesdecimalsnumber
How many decimal places to keep. Defaults to 0 (no decimals).Default: 0.

Outputs

The number rounded up, down, or to the nearest value at the chosen decimal places: a whole number when there are none.

Example output
3.14

Work out a percent change

Find by what percent a number went up or down, like sales from 80 to 100 is up 25%, and from 100 to 80 is down 20%.

Inputs

FromfromnumberRequired
The number before, like last month's sales.
TotonumberRequired
The number after, like this month's sales.

Outputs

The change in percent, to 2 decimal places: positive when the number went up, negative when it went down, blank when it started at 0.

Example output
25

Work out a percentage

Find what percent one number is of another, like 25 of 200 is 12.5%: a conversion rate, a share of the total, a progress bar.

Inputs

PartpartnumberRequired
The part, like the number of orders that converted.
Of the totaltotalnumberRequired
The whole it is part of, like every visit.

Outputs

The percentage, to 2 decimal places, without the % sign (12.5 for 12.5%), or blank when the total is 0.

Example output
12.5

On this page