Use functions in calculations
Learn about the inbuilt functions you can use when entering formulas in calculation columns.
This page describes the inbuilt functions you can use when entering formulas in calculation columns in Analytics.
ABS
ABS(value)
Returns the absolute value of a number. Positive numbers and 0 remain unchanged. Negative numbers are returned as positive numbers.
Input
value: The number or column to evaluate.
Examples
ABS(-2)returns2.In the image below, the ABS calculation column uses
ABS(Sep 2026, Value)to return the absolute value of each number in the Sep 2026 Value column.In rows 1 and 2,
-647.95and-6.06become647.95and6.06. Positive values, such as14.97in row 3, remain unchanged.
AND
AND(value1, value2)
Returns TRUE when all conditions are TRUE. If any condition is FALSE, it returns FALSE. Commonly used with the IF function.
Inputs
value1: The first condition to evaluate.value2…: Optional additional conditions.
Each condition must return a value that AND can evaluate as TRUE or FALSE. AND treats 0 as FALSE and any nonzero value, including a negative value, as TRUE.
Examples
AND(1, 1)returns1(TRUE) because both values are nonzero.AND(1, 0)returns0(FALSE) because one value is 0.In the image below, the AND calculation column uses
AND(IF(W35 2026, Value > 0, 1, 0), IF(W36 2026, Value > 0, 1, 0))to check whether the W35 2026 and W36 2026 values are both greater than 0. EachIFfunction returns1when its column's value is greater than 0 and0when it isn't. TheANDfunction then evaluates these results.In rows 6 and 9, W36 2026 is empty, so its
IFfunction returns 0. As a result,ANDreturns 0. In all other rows, bothIFfunctions return 1, soANDreturns 1.
ARRAY
ARRAY(value1, [value2…])
Groups one or more values into a single, ordered list. Commonly used as an input in other functions that require a series of values, such as FORECAST.LINEAR or PERCENTILE.
Inputs
value1: The first value or column within the list.[value2…]: Optional additional values or columns to add to the list.
Examples
ARRAY(1)returns an array containing one value:[1].ARRAY(1, 2, 3)returns an array containing three values:[1, 2, 3].See the FORECAST.LINEAR example for how to use ARRAY with quarterly columns to predict the next quarter's value.
See the PERCENTILE example for how to use ARRAY to group column values into a series and calculate a percentile.
AVERAGE
AVERAGE(value1, [value2…])
Returns the average of a series of numbers.
Inputs
value1: The first value, column, or column range to include in the average.[value2…]: Optional additional values, columns, or column ranges to include in the average.
Examples
AVERAGE(1, 2, 3)returns2.In the image below, the Average calculation uses
AVERAGE(Aug 2026 Value, Sept 2026 Value, Oct 2026 Value)to calculate the average of the three monthly values in each row.In row 1, the values are
87,109.72,91,837.45, and90,439.36. Their average is89,795.51.
Read the results in the Average column under Oct 2026. The other repeated calculation columns show #ERR.In the image below, the Average calculation uses
AVERAGE(2026-Q1 - 2026-Q4, 2025-Q1 - 2025-Q4)to calculate the average of the 2026 and 2025 annual values in each row.In row 1,
534,050.61and749,014.66give an average of641,532.64. This averages the two annual values, rather than the individual quarterly values.
COALESCE
COALESCE(value1, [value2…])
Returns the first non-empty value from a series of values, checking them in the order specified in the formula.
Use COALESCE when you want to use a value from one column but fall back to another column if the first is empty. For example, you can use a value from one period and fill gaps with values from another period. The source columns remain unchanged.
Inputs
value1: The first value or column to check.[value2…]: Optional additional values or columns to check, in order.
Examples
COALESCE([null, null, 1, 4, null])returns1, the first non-empty value.In the image below, the Coalesce calculation uses
COALESCE(Jan 2025 - Nov 2025, Jan 2026 - Nov 2026)to return the 2025 value when available and use the 2026 value when the 2025 cell is empty.In row 1, the result is
417,169.02from 2025. In row 5, the 2025 cell is empty, so the result is415,750.24from 2026. The order of the references in the formula determines which value is used, regardless of the columns' positions in the grid.
DAYS
DAYS(coordinate)
Returns the number of days in a period or period range, including weekends.
Use DAYS when a calculation depends on the number of days in a period, such as calculating a daily cost over a period.
Input
coordinate: The period or period range to calculate the number of days for. You must specify a period. Leaving the input empty returns an error.
Examples
DAYS(Jun 2024)returns30, the number of days in June 2024.DAYS(Jul 2025 - Dec 2025)returns184, the number of days from July to December 2025.In the image below, the Days in period calculation uses
DAYS(01/09/2026 - 05/11/2026)to return66, the number of days from September 1 to November 5, 2026, including both dates and weekends.Every row returns the same result because
DAYScounts the days in the column's period, regardless of the values in each row.
FINITE
FINITE(value, fallback, [-infinity], [+infinity])
Returns the original value if it is finite. If it is NaN (not a number), negative infinity, or positive infinity, returns the specified fallback value.
Use FINITE to replace non-finite calculation results with a value you choose, such as 0 when a calculation divides by zero.
Inputs
value: The number, column, or calculation to check.fallback: The value to return for any non-finite result when using two inputs. When using four inputs, this is the value returned for NaN.[-infinity]: The value returned for -infinity.[+infinity]: The value returned for +infinity.
Use two inputs to return the same fallback for all non-finite results. Use four inputs to return different values for NaN, negative infinity, and positive infinity, in that order.
Examples
FINITE(1/0, 0)returns0because dividing 1 by 0 produces a non-finite result.FINITE(-1/0, 1, 2, 3)returns2, the value defined for -infinity.FINITE(NaN, 0)returns0.In the image below, the FINITE calculation uses
FINITE(Sep 2026 Value / 0, 0). Each value in the Sep 2026 Value column is divided by 0, producing a non-finite result. The fallback is0, so every row displays0.00.
FORECAST.LINEAR
FORECAST.LINEAR(position, series)
Predicts a value at a given position in a series using linear regression, which fits a straight line to the known values.
Inputs
position: The position in the series to calculate the predicted value for. Positions start at 1. For example, use 5 to predict the next value after four known values.series: The known values to use for the linear regression. Create the series with theARRAYfunction or a range of columns.
Examples
FORECAST.LINEAR(5, ARRAY(100, 200, 300, 400))returns500.ARRAYsupplies the four known values. Position5predicts the next value in the series.In the image below, the Next quarter prediction calculation uses
FORECAST.LINEAR(5, ARRAY(2026-Q1 Value, 2026-Q2 Value, 2026-Q3 Value, 2026-Q4 Value))to predict Q1 2027 from the four quarterly values for 2026. The total prediction is432,445.03, rounded to two decimal places.ARRAYsupplies the four Value columns in order, from 2026-Q1 to 2026-Q4. Position5predicts the next quarter. Each row uses its own quarterly values to calculate its prediction.
Read the results in the Next quarter prediction column under 2026-Q4. The other repeated calculation columns show #ERR.
IF
IF(logical expression, value if true, value if false)
Returns one value when a condition is TRUE and another value when it is FALSE.
A logical expression is a statement that evaluates to either TRUE or FALSE.
Inputs
logical expression: A statement that evaluates to either TRUE or FALSE.value if true: The value returned if the logical expression is TRUE.value if false: The value returned if the logical expression is FALSE.
Use this function for if-then-else logic, such as setting a sales-based discount threshold.
Examples
In the image below, the IF calculation uses
IF(Sep 2026 Value > 0, 1, 0)to return1when the value is greater than 0. If the value is zero or less, it returns0.In row 1, the value is
-6.26, so the result is0. In row 6, the value is7.34, so the result is1.
IF(Sales > 7000000, Sales * 0.05, 0)returns 5% of sales when sales exceed 7 million. Otherwise, it returns0.See the NOT example for how to use IF with NOT to flag counts that differ from an expected value.
See the AND example for how to use IF with AND to check whether both weekly values are greater than 0.
See the OR example for how to use IF with OR to check whether at least one weekly value is greater than 0.
MAX
MAX(value1, [value2…])
Returns the largest number in a set of values. When you reference multiple columns, it compares the values in each row and returns the largest value for that row.
Use MAX to find the highest value across periods or measures. For example, compare monthly sales columns to find each customer's highest monthly sales value over a selected period.
Inputs
value1: The first value, column, or column range to compare.[value2…]: Optional additional values, columns, or column ranges to compare.
Examples
MAX(-2, 5, 10)returns10.MAX(Jul 2025 .. Dec 2025)returns the largest value in the range from July to December 2025.In the image below, the Max calculation uses
MAX(Aug 2026 Value, Sept 2026 Value, Oct 2026 Value)to find each customer's highest monthly sales value across August, September, and October 2026.In row 1, the monthly values are
65,300.17,91,005.30, and89,560.44. The result is91,005.30, the September value.
Read the results in the Max column under Aug 2026. The other repeated calculation columns show #ERR.
MIN
MIN(value1, [value2…])
Returns the smallest number in a set of values. When you reference multiple columns, it compares the values in each row and returns the smallest value for that row.
Use MIN to find the lowest value across periods or measures. For example, compare monthly sales columns to find each customer's lowest monthly sales value over a selected period.
Inputs
value1: The first value, column, or column range to compare.[value2…]: Optional additional values, columns, or column ranges to compare.
Examples
MIN(-2, 5, 10)returns-2.MIN(Jul 2025 .. Dec 2025)returns the smallest value in the range from July to December 2025.In the image below, the Min calculation uses
MIN(Aug 2026 Value, Sept 2026 Value, Oct 2026 Value)to find each customer's lowest monthly sales value across August, September, and October 2026.In row 1, the monthly values are
65,300.17,91,005.30, and89,560.44. The result is65,300.17, the August value.
Read the results in the Min column under Aug 2026. The other repeated calculation columns show #ERR.
NOT
NOT(condition1, [condition2…])
Reverses a logical result: TRUE becomes FALSE and FALSE becomes TRUE. Commonly used with the IF function.
Use NOT to flag values that do not meet a condition, such as counts that differ from an expected value.
Inputs
condition1: The first condition or value to evaluate.[condition2…]: Optional additional conditions or values to evaluate.
NOT treats 0 as FALSE and any nonzero value, including a negative value, as TRUE. It returns 1 for TRUE and 0 for FALSE.
Examples
NOT(1)returns0(FALSE).NOT(0)returns1(TRUE).In the image below, the NOT calculation uses
NOT(IF(W35 2026 Count = 4, 1, 0))to flag counts that differ from an expected value of 4.In row 1, Count is
4, soIFreturns1(TRUE).NOTreverses this to0(FALSE). In row 6, Count is3, soIFreturns0(FALSE).NOTreverses this to1(TRUE).
OR
OR(condition1, condition2, [condition3]…)
Returns TRUE when at least one condition is TRUE, including when all conditions are TRUE. If all conditions are FALSE, it returns FALSE. Commonly used with the IF function.
Use OR to flag rows that meet at least one of several conditions. For example, identify customers with positive sales in either of two weeks.
Inputs
condition1: The first condition or value to evaluate.condition2: The second condition or value to evaluate.[condition3…]: Optional additional conditions or values to evaluate.
OR treats 0 as FALSE and any nonzero value, including a negative value, as TRUE. It returns 1 for TRUE and 0 for FALSE.
Examples
OR(1, 0)returns1(TRUE) because at least one value is nonzero.OR(0, 0)returns0(FALSE) because both values are 0.In the image below, the OR calculation uses
OR(IF(W35 2026 Value > 0, 1, 0), IF(W36 2026 Value > 0, 1, 0))to check whether at least one of the two weekly values is greater than 0. EachIFfunction returns1when its column's value is greater than 0 and0otherwise.In rows 1 and 4, both weekly values are greater than 0, so
ORreturns1. In rows 2, 3, 5, and 6, only one weekly value is greater than 0, so the result is also1. In rows 7 to 10, neither weekly value is greater than 0, so the result is0.
PERCENTILE
PERCENTILE(series, k)
Returns the value at a specified percentile in a series of numbers. The result can fall between values in the series.
Use PERCENTILE to calculate a benchmark from a set of values. For example, use 0.5 with monthly sales columns to find each customer's median monthly sales value.
Inputs
series: The values or columns to evaluate, grouped using theARRAYfunction.k: The percentile to calculate, expressed as a number from 0 to 1, inclusive. For example,0.3represents the 30th percentile and0.5represents the 50th percentile (the median).
Examples
PERCENTILE(ARRAY(1, 2, 3, 4), 0.3)returns1.9, the 30th percentile of the series.PERCENTILE(ARRAY(1, 2, 3, 4), 0.5)returns2.5, the 50th percentile (the median).In the image below, the PERCENTILE calculation uses
PERCENTILE(ARRAY(Sep 2026 1, Sep 2026 2, Sep 2026 3, Sep 2026 4), 0.3). The calculation columns named 1, 2, 3, and 4 contain those numbers in each row.ARRAYgroups the four column values into the series, and0.3specifies the 30th percentile.Read the PERCENTILE results in the individual rows, where the result is
1.90. Changing the second input to0.5would return2.50. The total row displays#ERRin this screenshot.
PERIODCOUNT
PERIODCOUNT(column)
Returns the number of periods, such as months or days, associated with a column.
Use PERIODCOUNT when a calculation depends on how many periods a column covers, such as calculating an average value per month.
Input
column: The transaction column to find the period for.
Example
In the image below, the PERIODCOUNT calculation uses PERIODCOUNT(Oct 2025 - Sep 2026) to return 12. The selected column covers October 2025 to September 2026 and contains 12 monthly periods.
Every row displays 12.00 because the number of periods depends on the column's period range, rather than the values in each row.

POWER
POWER(base, exponent)
Returns a number raised to a power.
Use POWER to calculate repeated growth. For example, if a quantity doubles each period, POWER(2, 3) gives a growth factor of 8 after three periods. Multiply the starting quantity by this factor to calculate the final quantity.
Inputs
base: The number or column to raise to a power.exponent: The power to raise the base to.
Examples
POWER(2, 3)returns8, because 2 raised to the power of 3 is2 × 2 × 2 = 8.In the image below, the POWER calculation uses
POWER(Sep 2026 2, 3)to raise each value in the calculation column named 2 to the power of 3. Each row contains2.00, so every result is8.00.
RANK
RANK(value, [series])
Assigns a rank to a value based on how large it is compared to other values. The largest value receives rank 1.
Use RANK to compare performance. For example, rank customers by sales within a column, or see how a customer's sales for one month compare with their sales in other months.
Inputs
value: The value or column to rank.[series]: An optional series to rank the value against. Create the series using theARRAYfunction.
Examples
RANK(Oct 2026 Value)ranks the October values within their own column. The customer with the highest October value receives rank1.In the image below, the October sales rank calculation uses
RANK(Oct 2026 Value, ARRAY(Aug 2026 Value, Sept 2026 Value))to rank October sales against August and September sales for each customer. The comparison is within each row, rather than between customers.In row 1, October sales of
89,560.44rank2, below September but above August. In row 2, October ranks1, the highest of the three months. In row 9, October ranks3, the lowest.
Read the results in the October sales rank column under Oct 2026. The other repeated calculation columns show #ERR.
ROUND
ROUND(value, places)
Rounds a number to a specified number of decimal places.
Use ROUND to control the precision of values used in further calculations.
Inputs
value: The value or column to round.places: The number of decimal places to round to. Use 0 for whole numbers, a positive number for decimal places, or a negative number for tens, hundreds, and so on.
Use ROUND when other calculations should use a rounded value. Use Number format in the column menu when you only want to change how values are displayed. Changing the number format leaves the value used in calculations unchanged.
Examples
ROUND(2.558, 1)returns2.6.ROUND(1234, -3)returns1000.In the image below, the Rounded value calculation uses
ROUND(Value, 0)to round each value to a whole number.In row 1,
245,865.91becomes245,866. It displays as245,866.00because the column's number format shows two decimal places.
To hide the decimal places, open the Rounded value column menu and select Number format, then choose a format with no decimal places. In the image below, selecting 1235 displays the first result as
245866, without a thousands separator. This changes the display only.
SQRT
SQRT(value)
Returns the positive square root of a positive number.
Use SQRT when a calculation requires a square root. For example, calculate the side length of a square from its area: an area of 25 square meters gives a side length of 5 meters.
Input
value: The number or column for which to calculate the square root.
Examples
SQRT(4)returns2, because2 × 2 = 4.In the image below, the SQRT calculation uses
SQRT(Sep 2026 4)to calculate the square root of each value in the calculation column named 4. Every row contains4.00, so every result is2.00.
SUM
SUM(value1, [value2…])
Adds numbers, columns, or column ranges. When you reference multiple columns, it adds the values in each row.
Use SUM to combine values from selected columns, such as calculating a customer's total sales or transaction count across several months.
Inputs
value1: The first number, column, or column range to include in the sum.[value2…]: Optional additional numbers, columns, or column ranges to include in the sum.
Examples
SUM(1, 2, 3)returns6.In the image below, the SUM calculation uses
SUM(Jun 2026 Count, Jul 2026 Count, Aug 2026 Count)to add the three monthly Count values for each customer. Select each month's Count column header to include it in the formula.In row 1, the monthly counts are
5,5, and5, giving a total of15.
Read the results in the SUM column under Jun 2026. The other repeated calculation columns show #ERR.In the image below, the Sum Aug and Oct calculation uses
SUM(Aug 2026 Value, Oct 2026 Value)to combine sales for two selected months. September's value is excluded because its column is not included in the formula.In row 1, August sales of
39,594.81plus October sales of93,147.65give a total of132,742.46.
Read the results in the Sum Aug and Oct column under Aug 2026. The other repeated calculation columns show #ERR.
WORKINGDAYS
WORKINGDAYS(id, columns)
Returns the number of working days in a column's period or period range, as defined by the selected working days calendar.
Use WORKINGDAYS to calculate values per working day, such as average daily sales, using the calendar relevant to your business.
You need to set up working day calendars to use this function.
Inputs
id: The working days calendar to use. Select it from the list of available calendars.columns: The column or column range that supplies the period. Select a column associated with the period you want to count. Its measure and values do not affect the result. Leaving this input empty returns an error.
If you change the period associated with the selected column, the result updates to reflect the working days in the new period.
Steps
Select the
WORKINGDAYSfunction to display the list of available calendars.Select the calendar you want to use.

Select the column header associated with the required period.
Press Enter to apply the calculation.
Example
In the image below, the Working days excl hols calculation uses WORKINGDAYS(Working Days Excl Bank Holidays, Aug 2026 Value). The first input selects the calendar named Working Days Excl Bank Holidays. The second input selects the Value column for Aug 2026.
In this example, the selected calendar defines 21 working days in August 2026, 22 in September, and 22 in October. Each repeated calculation uses its month's period. Every row within a month returns the same result because the sales values do not affect the working day count. Results depend on how the selected calendar is set up.

To count all days in a period, including weekends, see DAYS.
Last updated
