SafetyCulture
  1. Home
  2. Using SafetyCulture
  3. Templates
  4. Add functions to calculation formulas

Templates

Last updated: October 20, 2025

Add functions to calculation formulas

Learn how to use functions in calculation formulas and explore the available options to create more accurate and efficient calculations via the web app and the mobile app.

What does it mean to add functions to formulas?

Manually extracting data from inspections and transferring it to spreadsheet programs for calculations can be time-consuming and inefficient. With functions in your calculation formulas, you can instantly process and analyze data within SafetyCulture, eliminating the need for third-party tools. This ensures you have real-time insights at your fingertips, enabling faster, data-driven decisions the moment information is captured.

Wistia video thumbnail

Users must have version 25.12 or later of the SafetyCulture mobile app to view functions added to calculation questions in inspections.

Add functions to a calculation formula

  1. Log in to the web app.

  2. Select Templates in the sidebar or select it in More.

  3. Click the template and select Edit template in the side panel.

  4. Add a new number response question or select an existing one.

  5. Create or edit a calculation formula.

  6. In the side panel, type $ and select the function you want to use. Then, type $ followed by a question's label to use it as an argument. Please note that functions are case-sensitive.

    • You can also select the relevant function and question from the "Functions" and "Questions" dropdowns.

  7. Click Save and apply.

  8. Click Publishon the upper-right of the page to publish the template. If you're not ready to publish the template, you can go back to the template list and publish the changes when you're ready.

Add functions to your calculation formula via the web app.

Formulas using number questions with units will not be converted automatically.

For example, if you’re calculating the speed in kilometers per hour, and you referenced a number question using meters as a unit in your calculation, meters will not be converted to kilometers. You will need to change the unit in the number question or the number question altogether.

What functions are available?

This table outlines all the available functions for calculation formulas. In a function, "Value" can either be a referenced question or an integer.

Function

Format

Description

ABS (Absolute value)

ABS(Value)

Returns the absolute (positive) value of the input. For example, ABS(-5) = 5.

AVEDEV (Average deviation)

AVEDEV(Value 1, Value 2)

Calculates the average deviation of the given values. For example, AVEDEV(4,8,6,5,9) = 1.68.

AVERAGE

AVERAGE(Value 1, Value 2)

Computes the average (mean) of all values. For example, AVERAGE(4,8,12) = 8.

CEIL (Ceiling)

CEIL(Value)

CEIL(Value 1, Value 2)

Rounds the value up to the nearest whole number or up to a defined number of decimal places. For example, CEIL(21.1171, 3) = 21.118.

COS (Cosine)

COS(Value)

Returns the cosine of the given radian. For example, COS(0) = 1.

DEFAULT_VALUE

DEFAULT_VALUE(Question, Default value)

The DEFAULT_VALUE function will need to reference a question and an integer in the respective order.

Returns the default value if a referenced question is unanswered. For example, DEFAULT_VALUE(Question, 15).

If the question is answered, the function is equal to the number entered.

If unanswered, the function is equal to 15.

FLOOR

FLOOR(Value)

FLOOR(Value 1, Value 2)

Rounds the value down to the nearest whole number or down to a defined number of decimal places. For example, FLOOR(21.1171, 1) = 21.1.

LOG

LOG(Value 1, Value 2)

Returns the logarithm of the first value to the base of the second. For example, LOG(8,2) = 3.

MAX

MAX(Value)

MAX(Value 1, Value 2)

Returns the largest number in a set of values. For example, MAX(7, 3, 2, 13, 5, 4) = 13.

MEDIAN

MEDIAN(Value 1, Value 2)

Returns the median value from the input numbers. For example, MEDIAN(3,1,4,2,5) = 3.

MIN

MIN(Value)

MIN(Value 1, Value 2)

Returns the smallest number in a set of values.
For example, MIN(7, 3, 2, 13, 5, 4) = 2.

MODE

MODE(Value 1, Value 2)

Returns the most frequently occurring value from the given values. For example, MODE(3,5,3,7,5,5) = 5.

POWER

POWER(Value 1, Value 2)

Raises the first value to the power of the second. For example, POWER (2,3) = 8.

RANGE

RANGE(Value)

RANGE(Value 1, Value 2)

Returns the difference between the largest and smallest numbers in a set of values.
For example, RANGE(7, 3, 2, 13, 5, 4) = 11.

ROUND

ROUND(Value)

ROUND(Value 1, Value 2)

Rounds the value to the nearest whole number or to a defined number of decimal places. For example, ROUND(21.1171, 2) = 21.12.

SIN (Sine)

SIN(Value)

Returns the sine of the given radian. For example, SIN(3.14 / 2) = 1.

SQRT (Square root)

SQRT(Value)

Returns the square root of the value. For example, SQRT(9) = 3.

STDEV (Standard deviation)

STDEV(Value 1, Value 2)

Calculates the standard deviation of the given values. For example, STDEV(4,8,6,5,9) = 1.87.

SUM

SUM(Value 1, Value 2)

Calculates the sum of all values. For example, SUM(1,5,9) = 15.

SUM_MC

SUM_MC(Value)

SUM_MC(Value 1, Value 2)

Calculates the total score of multiple choice responses.

To set a default value when a referenced question is unanswered, add a number after the question. For example, SUM_MC(Question, 0).

If the question is unanswered, the score will default to 0.

Frequently asked questions

Was this page helpful?

SafetyCulture
App Store
Google Play