Function Glossary
  • 09 Sep 2024
  • 12 Minutes to read
  • Dark
    Light

Function Glossary

  • Dark
    Light

Article summary

Overview

This document lists all of the available functions in Formulas.


Array

Function NameDescriptionFormula SyntaxExample
AGGREGATEPerforms a specified calculation (e.g., sum, product, average, etc.) for a list or database, with the option to ignore hidden rows and error valuesAGGREGATE(function_num, options, ref1, [ref2], ...)

{

        "Formula": "aggregate(makearray(1,2,3,4), 0, (acc, x) => acc + x))",

        "Result": "10"

      }

CountCounts the number of items in a collectionCount(collection)

   {

        "Formula": "count(makearray(1, 2, 3))",

        "Result": "3"

      }=3

FindReturns the first item in a list of objects that meets the criteriaFind(array, condition)

    {

        "Formula": "find(makearray(\"banana\", \"apple\", \"grape\"),  x => x == \"apple\")",

        "Result": "\"apple\""

      }

findallSearches for all occurrences of a specified pattern in a string and returns them as an array.findall(string, pattern)

   {

        "Formula": "findall(makearray(\"banana\", \"apple\", \"apple\"),  x => x == \"apple\")",

        "Result": "[\"apple\", \"apple\"]"

      }

IndexOfReturns the index of the first occurrence of a substring within a string.INDEXOF(string, substring)

     {

        "Formula": "indexof(makearray(1,2,3) ,1)",

        "Result": "0"

      }

JoinTakes two lists and returns a concatenated list.Join(array, array)

    {

        "Formula": "join(makearray(1,2),makearray(3,4))",

        "Result": "[1, 2, 3, 4]"

      }

makearrayCreates an array from a specified list of elements or a range.makearray(element1, element2, ..., elementN)

 {

        "Formula": "makearray(1,2,3)",

        "Result": "[1,2,3]"

      }

Conditional

Function NameDescriptionFormula SyntaxExample
IfReturns one value if a condition is true and another value if it is false.IF(condition, value_if_true, value_if_false)

     {

        "Formula": "if(true,1,2)",

        "Result": "1"

      }

Conversion

Function NameDescriptionFormula SyntaxExample
todouble
Converts a given value to a double-precision floating-point number.
todouble(value)

     {

        "Formula": "todouble(\"2.5\")",

        "Result": "2.5"

      }

toint
Converts a given value to an integer.
toint(value)

   {

        "Formula": "toint(\"2\")",

        "Result": "2"

      }

Date

Function NameDescriptionFormula SyntaxExample
AddDays
Adds a specified number of days to a date.
AddDays(date, days)

      {

        "Formula": "adddays(now(), 5)",

        "Result": "2024-08-19T00:00:00"

      }

DateAdd
Adds a specified number of intervals to a date.
DATEADD(date, interval, amount)
dateadd(now(), "d", 7)
DateDiff
Returns the difference between two dates.
DATEDIFF(start_date, end_date, interval)
datediff("2024-08-01", "2024-08-14", "Day")
DayReturns the day component of a date.
DAY(date)

 {

        "Formula": "day(now())",

        "Result": "current day of the month"

      }

MonthReturns the month component of a date.
MONTH(date)

   {

        "Formula": "month(now())",

        "Result": "current month"

      }

NowReturns the current date and time.
NOW()

     {

        "Formula": "now()",

        "Result": "current dateTime"

      }

TodayReturns the current date.
TODAY()

   {

        "Formula": "today()",

        "Result": "current date"

      }

YearReturns the year component of a date.
YEAR(date)

 {

        "Formula": "year(now())",

        "Result": "current year"

      }

Financial

Function NameDescriptionFormula SyntaxExample
AMORDEGRC
Calculates the depreciation for each accounting period based on a varying rate. The depreciation is higher at the beginning and decreases over time.
AMORDEGRC( cost, date_purchased, first_period, salvage, period, rate, [basis] )

amordegrc(10000, date1, date2, 1000, 1, 0.2, 0)

AMORLINC
Calculates the depreciation for each accounting period based on a constant rate. The depreciation amount is the same for each period.
AMORLINC( cost, date_purchased, first_period, salvage, period, rate, [basis] )

amorlinc(10000, now(), adddays(now(), 365), 1000, 1, 0.2, 0)

= 2000

CumIpmt
Calculates the cumulative interest paid between two periods of a loan based on constant payments and a constant interest rate.
CUMIPMT( rate, nper, pv, start_period, end_period, type )

cumipmt(0.05,12,1000,1,12,0)

= -353.90492

CumPrinc
Calculates the cumulative principal paid between two periods of a loan based on constant payments and a constant interest rate.
CUMPRINC( rate, nper, pv, start_period, end_period, type )

cumprinc(0.05,12,1000,1,12,0)

=-999.999999

DBCalculates the depreciation of an asset for a specified period using the double-declining balance method.
DB( cost, salvage, life, period, [month] )

db(1000, 100, 5, 1,12) 

= 369

DDBCalculates the depreciation of an asset for a specified period using the double-declining balance method, considering the factor.
DDB( cost, salvage, life, period, [factor] )

ddb(1000, 100, 5, 1, 12)

= 900

DurationCalculates the Macaulay duration of a bond.
DURATION(settlement, maturity, coupon, yield, frequency, basis

     {

        "Formula": "duration(now(), adddays(now(), 1825), 0.05, 0.04, 2, 0)",

        "Result": "4.4961258667484545"

      }

FVCalculates the future value of an investment based on periodic payments and a constant interest rate.
FV(rate, nper, pmt, pv)

     {

        "Formula": "fv(0.05, 10, -200, 1000)",

        "Result": "886.68"

      }


IPMTCalculates the interest portion of a loan payment for a given period.
IPMT(rate, period, nper, pv, fv)

   {

        "Formula": "ipmt(0.05, 1, 10, -1000, 0)",

        "Result": "50"

      }

IRRCalculates the internal rate of return for a series of cash flows.
IRR([array])

{

        "Formula": "irr(makearray(-1000, 300, 300, 300, 300))",

        "Result": "0.0771384729520835"

      }

NPER
Calculates the number of payment periods for an investment based on periodic payments and a constant interest rate.
IRR([array])

    {

        "Formula": "irr(makearray(-1000, 300, 300, 300, 300))",

        "Result": "0.0771384729520835"

      }

NPVCalculates the net present value of a series of cash flows.
NPV(rate, [array])

 {

        "Formula": "npv(0.1,1000, 500, 100)",

        "Result": "1397.4455296769345"

      }

PMTCalculates the periodic payment amount for an investment based on constant payments and a constant interest rate.
PMT(rate, nper, pv, fv)

    {

        "Formula": "pmt(0.05, 10, -1000, 0)",

        "Result": "129.50"

      }


PPMTCalculates the principal portion of a loan payment for a given period.
PPMT(rate, period, nper, pv, fv)

  {

        "Formula": "ppmt(0.08,10,10,200000,0)",

        "Result": "-27598.05"

      }

PVCalculates the present value of an investment based on future cash flows and a discount rate.
PV(rate, nper, pmt, fv)

{

        "Formula": "pv(0.05, 10, -1000, 0) ",

        "Result": "7721.73"

      }


RATECalculates the interest rate per period for an investment based on periodic payments, present value, and future value.
RATE(nper, pmt, pv, fv)

   {

        "Formula": "rate(4*12,-200,8000,1,0)",

        "Result": "0.00769"

      }

SLNCalculates the straight-line depreciation of an asset for a single period.
SLN( cost, salvage, life )

    {

        "Formula": "sln(10000, 1000, 5)",

        "Result": "1800"

      }= 1800.00

SYDCalculates the sum-of-the-years' digits depreciation of an asset for a specified period.
SYD(cost, salvage, life, per)

    {

        "Formula": "syd(30000, 7500, 10, 1)",

        "Result": "4090.9090"

      }

VDBCalculates the depreciation of an asset for a specified period using the variable-declining balance method.
VDB( cost, salvage, life, start_period, end_period, [factor], [no_switch] )

  {

        "Formula": "vdb(2400, 300, 10, 0, 1, 2)",

        "Result": "480"

      }

YieldCalculates the yield of a bond.
YIELD(settlement, maturity, rate, pr, redemption, frequency, basis)

      {

        "Formula": "vdb(2400, 300, 10, 0, 1, 2)",

        "Result": "480"

      }

Hasing

Function NameDescriptionFormula SyntaxExample
hash_basis_points
Generates a hash for the given basis points value.
hash_basis_points(value)

  {

    "Formula": "hash_basis_points(1,2)",

    "Result": "-0.947"

  }

hash_str_basis_points
Generates a hash for the given string basis points value
hash_str_basis_points(value)

   {

        "Formula": "hash_str_basis_points(\"10\",\"20\")",

        "Result": "-0.3307"

      }

Logical

Function NameDescriptionFormula Syntax
Example
AndReturns true if all arguments are true, false otherwise.
AND(argument1, argument2, ...)

  {

        "Formula": "and(makearray(true, true, false))",

        "Result": "false"

      }

IfNullReturns one value if a specified value is null and another value if it is not null.
IFNULL(value, value_if_null)

     {

        "Formula": "ifnull(null, \"No Value\")",

        "Result": "No Value"

      }

IsNullReturns true if a specified value is null, false otherwise.
ISNULL(value)

    {

        "Formula": "isnull(null)",

        "Result": "true"

      }

NotReturns the negation of a logical value.
NOT(logical_value)

     {

        "Formula": "not(true)",

        "Result": "false"

      }

OrReturns true if any argument is true, false otherwise.
OR(argument1, argument2, ...)

      {

        "Formula": "or(makearray(true,false,true))",

        "Result": "true"

      }

Math

Function Name
Description
Formula Syntax
Example
ABSReturns the absolute value (i.e., the modulus) of a supplied number.
ABS(number)

  {

        "Formula": "abs(-5)",

        "Result": "5"

      }

ACOSReturns the Arccosine of a number.
ACOS(number)

ACOS(-1)
= 3.14159265

ACOSHReturns the inverse hyperbolic cosine of a number.
ACOSH(number)

ACOSH(1) 

= 0

ACOTReturns the arccotangent of a number.
ACOT(number)

ACOT(1) 

= 0.78539816

ACOTHReturns the inverse hyperbolic cosine of a number.
ACOTH(number)

ACOTH(6)

= 0.16823612

ASINReturns the Arcsine of a number.
ASIN(number)

ASIN(1) 

= 1.57079633

ASINHReturns the Inverse Hyperbolic Sine of a number.
ASINH(number)

ASINH(0)

=0

ATANReturns the Arctangent of a given number.
ATAN(number)

ATAN(1)

= 0.7853981633974483

ATANHReturns the Inverse Hyperbolic Tangent of a given number.
ATANH(number)

ATANH(0)

=0

CBRTReturns the cube root of a number.
CBRT(number)

cbrt(8)

= 2

CeilingRounds a number up to the nearest integer.
Ceiling(number)

ceiling(3.2) 

= 4

ClampRestricts a value to be within a specified range.
Clamp(value, min, max)

clamp(5, 0, 10)

= 5

CoalesceReturns the first non-null value in a list of values.
Coalesce(value1, value2, ...)

coalesce(null, 5, 10) 

= 5

Coalesce_all
Returns the first non-null value in a list of values.
Coalesce_all(value1, value2, ...)

coalesce_all(null, 10, 20) 

= 10

CorrelThe CORREL function returns the correlation coefficient of two cell ranges. Use the correlation coefficient to determine the relationship between two properties. For example, you can examine the relationship between a location's average temperature and the use of air conditioners.
CORREL(array1, array2)

correl([1,2,3], [4,5,6])

= 1

COSReturns the Cosine of a given angle.
COS(angle)

cos(0) 

= 1

COSHReturns the hyperbolic cosine of a number.
COSH(number)

cosh(0) 

= 1

COTReturns the cotangent of an angle.
COT(angle)

cot(1)

= 0.6420926159343308

COTHReturns the hyperbolic cotangent of an angle.
COTH(angle)

coth(1)

= 1.3130352854993312

CSCReturns the cosecant of an angle.
CSC(angle)

csc(1)

= 1.1883951057781212

CSCHReturns the hyperbolic cosecant of an angle.
CSCH(angle)

csch(1)

= 0.8509181282393216

DEGREES
Converts Radians to Degrees.
DEGREES(angle)

degrees(1)

= 57.29577951308232

EvenRounds a number away from zero (i.e., rounds a positive number up and a negative number down), to the next even number.
Even(number)

even(5.5) 

=6

EXPReturns Euler's number raised to the power of a specified number.
EXP(number)

exp(1) 

= 2.718281828459045

Expm1Returns Euler's number raised to the power of a specified number minus one.
Expm1(number)

expm1(1) 

= 1.718281828459045

FloorRounds a number down to the nearest integer.
Floor(number)

floor(3.8)

= 3

GCDReturns the Greatest Common Divisor of two or more supplied numbers.
GCD(number1, number2, ...)

gcd(20, 30)

= 10

IsInfiniteChecks if a given number is infinite, returning true or false.
IsInfinite(number)

isinfinite(1)

= true


IsNanReturns true if the value is NaN (not a number), false otherwise.
IsNan(value)

isnan(5) 

= false

IsNegativeReturns true if the value is negative, false otherwise.
IsNegative(value)

isnegative(-5) 

= true

IsNormalReturns true if the value is a normal floating-point value, false otherwise.
IsNormal(value)

isnormal(1.5)

= true

IsPositiveReturns true if the value is positive, false otherwise.
IsPositive(value)

ispositive(5) 

= true

IsPow2Returns true if the value is a power of 2, false otherwise.
IsPow2(value)

ispow2(16)

= true

IsRealReturns true if the value is a real number, false otherwise.
IsReal(value)

isreal(5) 

= true

IsSubNormalReturns true if the value is a subnormal floating-point value, false otherwise.
IsSubNormal(value)

issubnormal(0.1)

= false

LCMReturns the Least Common Multiple of two or more supplied numbers.
LCM(number1, number2, ...)

lcm(20, 30)

= 60

LogReturns the natural logarithm of a number.
Log(number)

log(10) 

= 2.302585092994046

Log10Returns the base-10 logarithm of a number.
Log10(number)

log10(100) 

= 2

Log2Returns the base-2 logarithm of a number.
Log2(number)

log2(8) 

= 3

LogBReturns the logarithm of a number with respect to a specified base.
LogB(base, number)

logB(2, 8) 

= 3

LogisticReturns the logistic function value at a given input.
Logistic(x)

logistic(0) 

= 0.5

MaxReturns the maximum of two or more numbers.
Max(number1, number2, ...)

max(5, 3, 7) 

= 7

MeanCalculates the mean (average) of a set of values.
MEAN(value1, value2, ...)

mean(10, 20, 30, 40) 

=25
MEDIANThe median is the middle value in a sorted list of numbers. If there is an odd number of observations, it's the middle value. If there is an even number, it is the average of the two middle values.

If n is odd: 

MEDIAN(x1, x2, ..., xn) = x((n + 1)/2)


If n is even: 

MEDIAN(x1, x2, ..., xn) = (x(n/2) + x((n/2) + 1)) / 2

median(10, 20, 30)

= 20

MinReturns the minimum of two or more numbers.
Min(number1, number2, ...)

min(5, 3, 7) 

= 3

MODReturns the remainder from a division between two supplied numbers
MOD(number, divisor)

mod(10, 3) 

= 1

ModeCalculates the mode (most frequent value) of a set of values
MODE(value1, value2, ...)

mode(1, 2, 3, 3) 

= 3

NegateReturns the negation of a number.
Negate(number)

negate(5) 

= -5

OddRounds a number away from zero (i.e., rounds a positive number up and a negative number down), to the next odd number.
Odd(number)

odd(5.5) 

= 5

powReturns the result of a given number raised to a supplied power.
POW(number, power)

pow(2, 3) 

= 8

PRODUCTThis function multiplies all the numbers in a range of cells.
PRODUCT(x1, x2, x3, ..., xn) = x1 * x2 * x3 * ... * xn

product(2, 3, 4, 5) 

= 120

QUOTIENTReturns the integer portion of a division between two supplied numbers.
QUOTIENT(numerator, denominator)

quotient(10, 3) 

= 3

RADIANS
Converts Degrees to Radians
RADIANS(angle)

radians(180) 

= 3.141592653589793

RandomGenerates a random number below the provided max number.
random(max)

random(20)

= 18

RoundRounds a number up or down, to a given number of digits.
Round(number, num_digits)

round(5.555, 2) 

= 5.56

RoundDec
Rounds a number to a specified number of decimal places.
rounddec(value,[places])

RoundDownRounds a number towards zero (i.e., rounds a positive number down and a negative number up), to a given number of digits.
RoundDown(number, num_digits)

rounddown(5.555, 2)

= 5.55

RoundUpRounds a number away from zero (i.e., rounds a positive number up and a negative number down), to a given number of digits.
RoundUp(number, num_digits)

roundup(5.555, 2) 

= 5.56


SECReturns the secant of an angle.
SEC(angle)

sec(1)  

= 1.8505157176809255

SECHReturns the hyperbolic secant of an angle.
SECH(angle)

sech(0) 

= 0

SIGNReturns the sign (+1, -1, or 0) of a supplied number
SIGN(number)

sign(-5) 

= -1

SINReturns the Sine of a given angle.
SIN(angle)

sin(1)

= 0.8414709848078965

SINHReturns the Hyperbolic Sine of a number.
SINH(number)

sinh(0) 

= 0

SlopeReturns the slope of the linear regression line through data points in known_y's and known_x's. The slope is the vertical distance divided by the horizontal distance between any two points on the line, which is the rate of change along the regression line.
SLOPE(List,List)

slope([1,3], [9,6])

= -1.5

SQRT
Returns the positive square root of a given number.
SQRT(number)

sqrt(16) 

= 4

SQRTPIReturns the square root of a supplied number multiplied by pi.
SQRTPI(number)

sqrtpi(4) 

= 3.5449077018110318

SumReturns the sum of a supplied list of numbers.
SUM(number1, number2, ...)

sum(1, 2, 3) 

= 6

SumIfAdds the cells in a supplied range that satisfy a given criteria.
SUMIF(range, criteria, [sum_range])

sumif(makearray(1, 2, 3), x => x > 2)

=3

SUMPRODUCTThis function multiplies the corresponding components in the given arrays (or ranges) and returns the sum of those products.

SUMPRODUCT(array1, array2) = Σ(array1[i] * array2[i])


Where:

- Σ denotes the sum over all elements i

- array1[i] and array2[i] are corresponding elements in the arrays or ranges.


sumproduct(makearray(1, 3), makearray(9, 6))

=27

TANReturns the Tangent of a given angle.
TAN(angle)

tan(1)

= 1.5574077246549023

TANHReturns the Hyperbolic Tangent of a given number.
TANH(number)

tanh(0) 

= 1

TruncTruncates a number towards zero (i.e., rounds a positive number down and a negative number up), to the next integer.
Trunc(number)

trunc(5.555) 

= 5

Statistical

Function Name

Description
Formula Syntax
Example
AVEDEV
Average Deviation: It measures the average of the absolute deviations of data points from their mean. It is calculated by summing the absolute differences between each data point and the mean, then dividing by the number of data points.

AVEDEV(x1, x2, ..., xn) = (Σ|xi - μ|) / n


Where:

- Σ denotes the sum from i = 1 to n

- |xi - μ| is the absolute deviation of each value from the mean

- μ is the mean of the dataset

- n is the number of values in the dataset


avedev(2,4) 

= 1

Percentile
Calculates the value at a specified percentile in a dataset.
PERCENTILE(data, percentile)

percentile([2,4], 0.5) 

= 3

QuartileCalculates the value at a specified quartile in a dataset.
QUARTILE(data, quartile)

quartile([2,4], 3) 

= 3.5

stdevpCalculates the standard deviation based on the entire population.
stdevp(array)

stdevp(2,4) 

= 1

stdevsCalculates the standard deviation based on a sample.
stdevs(array)

stdevs(2,4) 

= 1.4142135623730951

VariancepComputes the variance based on the entire population.
Variancep(array)

variancep(2,4) 

= 1

variancesComputes the variance based on a sample.
variances(array)

variances(2,4) 

= 2

String

Function Name

Description
Formula Syntax
Example
CONTCAT
Concatenates two or more strings.
CONCAT(string1, string2, ...)

concat("Hello", " ", "World") 

= "Hello World"

containsChecks if a specified substring exists within a string, returning true or false.
contains(string, substring, caseinsensitive)

contains("Hello", "H", true)

= true


indexofsubstring
Returns the index of the first occurrence of a specified substring within a string.
indexofsubstring(string, substring)

  {

        "Formula": "indexofsubstring(\"Hello\", \"D\")",

        "Result": "-1"

      },

      {

        "Formula": "indexofsubstring(\"Hello\", \"H\")",

        "Result": "0"

      }

JoinStrings
Concatenates all elements of a collection into a single string, using a specified separator.
Join(collection, separator)

joinstrings(["Hello","World"], ".")

= "Hello.World"


LengthReturns the length of a string.
LENGTH(string)

length("Hello World")

= 11

LowerConverts a string to lowercase.
LOWER(string)

lower("HELLO")

=hello

ReplaceReplaces all occurrences of a substring within a string with another substring.
REPLACE(string, old_substring, new_substring)

    {

        "Formula": "replace(\"Hello World\", \"World\", \"Universe\")",

        "Result": "Hello Universe"

      }

SubstringReturns a substring from a string.
SUBSTRING(string, start_index, length)

substring("Hello World", 6, 5)

= "World"

TrimRemoves leading and trailing whitespace from a string.
TRIM(string)

trim(" Hello World ")

= "Hello World"

UpperConverts a string to uppercase.
UPPER(string)

upper("hello")

= "HELLO"


Was this article helpful?

What's Next