Skip to content

Math Functions ​

SheetX provides custom mathematical functions that make common calculations easier to perform directly in Google Sheets.

These functions are designed to simplify calculations while giving you more control over how common edge cases, such as division by zero, are handled.

Functions Overview ​

FunctionDescription
SX_DIVIDEDivides one value by another with configurable zero-division behavior.
SX_PERCENTOFCalculates what percentage one value represents of another.

SX_DIVIDE ​

Divides one number by another and allows you to specify what should happen when the denominator is zero.

Syntax ​

text
SX_DIVIDE(dividend, divisor, [skip_nnv], [when_div0_err])

Arguments ​

ArgumentDescription
dividendThe number to be divided.
divisorThe number to divide the dividend by.
[skip_nnv]Determines how non-numeric values are handled.

False - Throw an error when value is not numeric.
True - Skips the non-numeric value. Skipping turnss all non-numeric to zero.

Default: True
[when_div0_err]Determines how #DIV/0! errors are handled.

False - #DIV/0! error is ignored;
True - Throw #DIV/0! error;
Any - Any value to display when a #DIV/0! error occurs.

Default: 0

Use Cases ​

  • Need to safely divide two values.
  • Want to avoid #DIV/0! errors.
  • Need different behavior when the denominator is zero.
  • Want formulas that remain clean when working with incomplete datasets.

SX_PERCENTOF ​

Calculates the percentage of the total represented by a subset of values.

Syntax ​

text
SX_PERCENTOF(data_subject, data_alll, [skip_nnv], [when_div0_err])

Arguments ​

ArgumentDescription
data_subjectThe value you want to express as a percentage.
data_allThe total or reference value.
[skip_nnv]Determines how non-numeric values are handled.

False - Throw an error when value is not numeric.
True - Skips the non-numeric value. Skipping turnss all non-numeric to zero.

Default: True
[when_div0_err]Determines how #DIV/0! errors are handled.

False - #DIV/0! error is ignored;
True - Throw #DIV/0! error;
Any - Any value to display when a #DIV/0! error occurs.

Default: 0

Common use cases ​

  • Sales contribution
  • Budget allocation
  • Inventory analysis
  • Completion rates
  • Customer segmentation
  • Survey results
  • Conversion rates
  • KPI calculations