SimLang Functions
This page documents all built-in functions available in SimLang as implemented in Epicenter.
Table of contents
Click one of the function categories below or use the detailed table of contents on the right.
Operators
Logical operators can be part of an equation for any variable or decision. They are listed below in order of precedence (highest first).
| Operator | Description |
|---|---|
! | Logical NOT |
% | Percent — divides the value immediately to its left by 100 |
^ | Power |
* / | Multiply, Divide |
+ - | Add, Subtract |
== != | Logical equal, not equal |
> < >= <= | Comparison operators |
&& | Logical AND |
|| | Logical OR |
Logical functions
AND
Returns 1 (true) if all arguments are non-zero; returns 0 (false) if any argument is 0.
Syntax
AND(<expr1>, <expr2>, ...)
Example
V All True = AND(1, 5 > 4, 5 == 2) # returns 0
FALSE
Returns 0.
IF
Returns second argument if condition is true (non-zero), third argument if false (0).
Syntax
IF(<condition>, <if_true>, <if_false>)
Example
V Sell Stock = IF(58 > 20, 1, 0) # returns 1
NOT
Inverts a logical expression. Returns 0 if argument is non-zero, 1 if argument is 0.
Syntax
NOT(<expr>)
Example
V Opposite = NOT(FALSE) # returns 1
OR
Returns 0 if all arguments are 0; returns 1 if any argument is non-zero.
Syntax
OR(<expr1>, <expr2>, ...)
Example
V One Is True = OR(0, 3 > 2, 10 == 11) # returns 1
TRUE
Returns 1.
Mathematical functions
Some math functions may return NaN (not a number) for invalid inputs.
ABS
Absolute value.
Syntax
ABS(<expr>)
Example
V Change = ABS(-100) # returns 100
ACOS
Arc cosine in radians.
Syntax
ACOS(<expr>)
ASIN
Arc sine in radians.
Syntax
ASIN(<expr>)
ATAN
Arc tangent in radians.
Syntax
ATAN(<expr>)
CEILING
Rounds up to the nearest multiple of <significance> (default 1).
Syntax
CEILING(<expr>, <significance>)
Example
V Value = CEILING(44.2, 10) # returns 50
V Value = CEILING(2.5, 1) # returns 3
COS
Cosine of an angle in radians.
Syntax
COS(<expr>)
COSH
Hyperbolic cosine.
Syntax
COSH(<expr>)
E
Returns the value of e (2.718281828…).
EXP
Returns e raised to the given power.
Syntax
EXP(<expr>)
FLOOR
Rounds down to the nearest multiple of <significance> (default 1).
Syntax
FLOOR(<expr>, <significance>)
Example
V Value = FLOOR(112.7, 10) # returns 110
V Value = FLOOR(112.7) # returns 112
FRAC
Returns the fractional part of a number.
Syntax
FRAC(<expr>)
Example
V Population = FRAC(40.9) # returns 0.9
INT
Rounds down to the nearest integer (toward negative infinity).
Syntax
INT(<expr>)
Example
V Population = INT(40.9) # returns 40
LN
Natural logarithm.
Syntax
LN(<expr>)
LOG10
Base-10 logarithm.
Syntax
LOG10(<expr>)
MOD
Modulus (remainder after division).
Syntax
MOD(<expr>, <divisor>)
Example
V Remainder = MOD(8, 3) # returns 2
V Remainder = MOD(-1, 10) # returns 9
NAN
Returns NaN (not a number).
PCT
Converts a fraction to a percentage (multiplies by 100).
Syntax
PCT(<expr>)
Example
V Profitability = PCT(0.34) # returns 34
PI
Returns π (3.14159…).
ROUND
Rounds to a specified number of digits. If <num_digits> is omitted, rounds to nearest integer.
Syntax
ROUND(<expr>, <num_digits>)
Example
V Value = ROUND(2.15, 1) # returns 2.2
V Value = ROUND(45.7, -1) # returns 50
ROUNDDOWN
Rounds toward zero to a specified number of digits.
Syntax
ROUNDDOWN(<expr>, <num_digits>)
ROUNDUP
Rounds away from zero to a specified number of digits.
Syntax
ROUNDUP(<expr>, <num_digits>)
SAFEDIV0
Divides <expr1> by <expr2>; returns 0 if <expr2> is 0.
Syntax
SAFEDIV0(<expr1>, <expr2>)
SAFEDIVX
Divides <expr1> by <expr2>; returns <expr3> if <expr2> is 0.
Syntax
SAFEDIVX(<expr1>, <expr2>, <expr3>)
SIGN
Returns 1 if positive, 0 if zero, -1 if negative.
Syntax
SIGN(<expr>)
SIN
Sine of an angle in radians.
Syntax
SIN(<expr>)
SINH
Hyperbolic sine.
Syntax
SINH(<expr>)
SQRT
Square root. Returns NaN for negative inputs.
Syntax
SQRT(<expr>)
Example
V Root = SQRT(1000000) # returns 1000
TAN
Tangent of an angle in radians.
Syntax
TAN(<expr>)
TANH
Hyperbolic tangent.
Syntax
TANH(<expr>)
TRUNC
Truncates to an integer by removing the fractional part.
Syntax
TRUNC(<expr>)
Example
V Truncated = TRUNC(45.764) # returns 45
V Truncated = TRUNC(-8.9) # returns -8
Time functions
Time functions return values that change with each step or depend on values over time.
ACCUM
Accumulates <value> for each time step. If <init> is omitted, uses the first argument as the initial value.
Syntax
ACCUM(<value>, <init>)
Example
V Cumulative Sales = ACCUM(1, 100)
# Step 0: 100, Step 1: 101, Step 2: 102
ACCUMPERIOD
Returns the cumulative amount of <expr> over a <period> of steps, with optional <offset> and <initialvalue>.
Syntax
ACCUMPERIOD(<expr>, <period>, <offset>, <initialvalue>)
DELAY
Delays <input> by <delaytime> steps. Quantities in the pipeline are conserved even if the delay time changes.
Syntax
DELAY(<input>, <delaytime>, <initialvalue>)
Example
V Two Step Delay = DELAY(5, 2, 0)
# Step 0: 0, Step 1: 0, Step 2: 5, Step 3: 5
DELAYSTATE
Returns the internal state of a delay variable. <state_subscript> 1 returns the current output, 2 returns the next upcoming output, etc.
Syntax
DELAYSTATE(<delayed_variable>, <state_subscript>)
DERIVN
Returns the Nth order derivative of <input>. Defaults to first order.
Syntax
DERIVN(<input>, <order>)
ENDSTEP
Returns the final step number of the simulation (0-based).
Example
M StartTime = 2010
M EndTime = 2020
V Last Step = ENDSTEP # returns 10
ENDTIME
Returns the EndTime property value.
FORECAST
Returns a forecasted future value based on <input>, an <averagingtime>, and a <futuretime>.
Syntax
FORECAST(<input>, <averagingtime>, <futuretime>, <initial>)
HIVAL
Returns the highest value seen since the start of the simulation.
Syntax
HIVAL(<expr>)
IMMEDIATE
Returns the current user-entered value of a decision even when ExecuteDecisionImmediately is false.
Syntax
IMMEDIATE(<decision>)
INITIAL
Stores and always returns the initial value of an expression.
Syntax
INITIAL(<expr>)
Example
V Initial Sales = INITIAL(10 + STEP)
# Returns 10 at every step
INTERVALCOUNT
Counts steps where <expr> is within [<lowval>, <hival>]. Optional <includeHiVal> argument controls whether the upper bound is inclusive.
Syntax
INTERVALCOUNT(<expr>, <lowval>, <hival>, <includeHiVal>)
LOVAL
Returns the lowest value seen since the start of the simulation.
Syntax
LOVAL(<expr>)
NONNEGATIVE
Used as the third argument to STOCK to force a stock to always be zero or positive.
PREVIOUS
Returns the value from the previous step. <initvalue> is the value returned at step 0.
Syntax
PREVIOUS(<expr>, <initvalue>)
Example
V Sales = PREVIOUS(Sales * 1.1, 100)
# Step 0: 100, Step 1: 110, Step 2: 121
PULSE
A periodic pulse starting at <first> and repeating every <interval>. Pulse amount is <volume> / timestep.
Syntax
PULSE(<volume>, <first>, <interval>)
RAMP
Returns 0 before <starttime>, then increases with <slope> per time unit until <stoptime>, then holds constant.
Syntax
RAMP(<slope>, <starttime>, <stoptime>)
Example
V Steady Growth = RAMP(1, 1, 3)
# Step 0: 0, Step 1: 0, Step 2: 1, Step 3: 2, Step 4: 2
REMEMBER
Reads and stores a value from <inputstream> whenever <condition> is true.
Syntax
REMEMBER(<condition>, <inputstream>, <initvalue>)
SAMPLE
Periodically samples and holds a value from <inputstream>.
Syntax
SAMPLE(<inputstream>, <first>, <interval>, <initial>)
STEP
Returns the current step number (0-based).
SMOOTH
Returns an exponential smooth of <input>.
Syntax
SMOOTH(<input>, <delaytime>, <order>, <initial>)
Example
V Perceived Value = SMOOTH(10, 2, 1, 0)
# Step 0: 0, Step 1: 5, Step 2: 7.5, Step 3: 8.75
STARTTIME
Returns the StartTime property value.
STEPCHANGE
Returns 0 before <starttime>, then <height> from that step onward.
Syntax
STEPCHANGE(<height>, <starttime>)
STOCK
Accumulates flows. Equivalent to a system dynamics stock. If NONNEGATIVE is passed as the third argument, the stock is always forced to zero or positive after each step.
Syntax
STOCK(<flow>, <initialvalue>, <nonnegative>)
Example
V Inventory = STOCK(5, 100)
# Step 0: 100, Step 1: 105, Step 2: 110
V Inventory = STOCK(-10, 0, NONNEGATIVE)
# Step 0: -10, Step 1: 0, Step 2: 0
TIME
Returns the current simulation time.
TIMECYCLE
Returns 1 for <duration> steps every <interval>, starting at <first>; returns 0 otherwise.
Syntax
TIMECYCLE(<first>, <interval>, <duration>)
TIMESTEP
Returns the TimeStep property value.
TREND
Returns the relative change in <input> per time unit.
Syntax
TREND(<input>, <averagingtime>, <initial>)
Financial functions
ARRAYIRR
Internal Rate of Return for an array of cash flows. If multiple valid IRR values exist, returns the one closest to <guess> (default 0.2).
Syntax
ARRAYIRR(<cash_flow_array>, <guess>)
Example
V IRR = ARRAYIRR({-100, 30, 30, 30, 30, 30}) # returns 0.15
ARRAYNPV
Net Present Value for an array of cash flows at a given discount <rate>.
Syntax
ARRAYNPV(<cash_flow_array>, <rate>)
Example
V NPV = ARRAYNPV({-100, 30, 30, 30, 30, 30}, 10%) # returns 12.48
FV
Future Value. <type> 0 = payment at start of period (default), 1 = end of period.
Syntax
FV(<rate>, <nper>, <pmt>, <pv>, <type>)
Example
V Future Value = FV(10%, 3, -1000, 100, 0) # returns 3176.90
NPER
Number of periods to pay off an investment.
Syntax
NPER(<rate>, <pmt>, <pv>, <fv>, <type>)
Example
V Periods = NPER(10%, -200, -2000, 5000, 0) # returns 5.87
NPV
Net Present Value accumulated over time as cash flows occur.
Syntax
NPV(<rate>, <amount>, <starttime>)
PMT
Payment amount for an investment.
Syntax
PMT(<rate>, <nper>, <pv>, <fv>, <type>)
Example
V Payment = PMT(10%, 10, -2000, 1000, 0) # returns 262.75
PV
Present Value.
Syntax
PV(<rate>, <nper>, <pmt>, <fv>, <type>)
Example
V Present Value = PV(10%, 3, -1000, 100, 0) # returns 2411.72
Array functions
ARRAYACCUM
Cumulative sum of array elements. The Nth element of the result is the sum of the Nth element and all preceding elements.
Syntax
ARRAYACCUM(<array>)
Example
V Cumulative[4] = ARRAYACCUM({10, 20, 30, 40}) # returns {10, 30, 60, 100}
ARRAYALLOCP
Distributes supply across a vector of requests according to a vector of priorities.
Syntax
ARRAYALLOCP(<supply>, <requestvector>, <priorityvector>, <width>)
ARRAYAREAXY
Area under an XY curve between x values <start> and <end>.
Syntax
ARRAYAREAXY(<start>, <end>, {{X1,Y1},{X2,Y2},...})
ARRAYAVG
Average of array elements.
Syntax
ARRAYAVG(<array>)
Example
V Avg = ARRAYAVG({0, 10, 90, 100}) # returns 50
ARRAYCOUNT
Number of elements in an array.
Syntax
ARRAYCOUNT(<array>)
Example
V Count = ARRAYCOUNT({0, 10, 90, 100}) # returns 4
ARRAYCOUNTEQ
Count of elements equal to <target>.
Syntax
ARRAYCOUNTEQ(<target>, <array>)
ARRAYCOUNTGT
Count of elements greater than <target>.
Syntax
ARRAYCOUNTGT(<target>, <array>)
ARRAYCOUNTGTEQ
Count of elements greater than or equal to <target>.
Syntax
ARRAYCOUNTGTEQ(<target>, <array>)
ARRAYCOUNTLT
Count of elements less than <target>.
Syntax
ARRAYCOUNTLT(<target>, <array>)
ARRAYCOUNTLTEQ
Count of elements less than or equal to <target>.
Syntax
ARRAYCOUNTLTEQ(<target>, <array>)
ARRAYCOUNTNEQ
Count of elements not equal to <target>.
Syntax
ARRAYCOUNTNEQ(<target>, <array>)
ARRAYGRAPH
Lookup with linear interpolation from an equally spaced table. If input is below <startx>, returns first output; if above the last x, returns last output.
Syntax
ARRAYGRAPH(<input>, <startx>, <intervalx>, {<outval1>, <outval2>, ...})
Example
V Result = ARRAYGRAPH(STEP, 0, 2, {10, 30, 0})
# Step 0: 10, Step 1: 20, Step 2: 30, Step 3: 15
ARRAYGRAPHSTEP
Lookup without interpolation from an equally spaced table.
Syntax
ARRAYGRAPHSTEP(<input>, <startx>, <intervalx>, {<outval1>, <outval2>, ...})
ARRAYGRAPHXY
Lookup with linear interpolation from a table of ordered pairs {X, Y}. <interpolation_mode>: 0 = linear (default), 1 = start of segment, 2 = end of segment. <extrapolation_mode>: 0 = constant (default), 1 = linear, -1 = NaN.
Syntax
ARRAYGRAPHXY(<input>, {{X1,Y1},{X2,Y2},...}, <interpolation_mode>, <extrapolation_mode>)
Example
# Equivalent of a Vensim Lookup:
V Crowding Effect Lookup[1..8, 1..2] = {
{0,0.333},
{0.207951,0.403509},
{0.66055,0.692982},
{1,1},
{1.65138,1.48246},
{2.53211,1.80702},
{3.21713,1.9386},
{3.93884,2}
}
V Crowding Effect = ARRAYGRAPHXY(Rabbit Population / Carrying Capacity, Crowding Effect Lookup)
ARRAYGRAPHYX
Like ARRAYGRAPHXY, but looks up input on the Y axis.
Syntax
ARRAYGRAPHYX(<input>, {{X1,Y1},{X2,Y2},...}, <interpolation_mode>, <extrapolation_mode>)
ARRAYMAX
Maximum element in an array.
Syntax
ARRAYMAX(<array>)
ARRAYMEDIAN
Median value of an array.
Syntax
ARRAYMEDIAN(<array>)
ARRAYMIN
Minimum element in an array.
Syntax
ARRAYMIN(<array>)
ARRAYMIRR
Modified IRR considering both cost of investment and reinvestment interest.
Syntax
ARRAYMIRR(<array>, <finance_rate>, <reinvestment_rate>)
ARRAYPRODUCT
Product of all array elements.
Syntax
ARRAYPRODUCT(<array>)
Example
V Product = ARRAYPRODUCT({4, 2, 1, 3}) # returns 24
ARRAYRANK
Relative rank of each element. Duplicates are ranked by position from left.
Syntax
ARRAYRANK(<array>)
Example
V Ranks[4] = ARRAYRANK({400, 200, 200, 300}) # returns {4, 1, 2, 3}
ARRAYSLOPEXY
Slope of a curve at a point, from a table of ordered pairs.
Syntax
ARRAYSLOPEXY(<input>, {{X1,Y1},{X2,Y2},...}, <extrapolation_mode>)
ARRAYSORT
Sorts an array in ascending order (only the first dimension for multi-dimensional arrays).
Syntax
ARRAYSORT(<array>)
Example
V Sorted[4] = ARRAYSORT({40, 20, 10, 30}) # returns {10, 20, 30, 40}
ARRAYSTDDEV
Standard deviation of array elements (equivalent to Excel's STDEVP).
Syntax
ARRAYSTDDEV(<array>)
Example
V StdDev = ARRAYSTDDEV({0, 10, 90, 100}) # returns 45.27
ARRAYSUM
Sum of all array elements.
Syntax
ARRAYSUM(<array>)
Example
V Total = ARRAYSUM({0, 10, 90, 100}) # returns 200
FIRST
Returns the first index or enumerated item in a range.
Syntax
FIRST(<rangename>)
Example
R Array Range = 5..27
V First Element = FIRST(Array Range) # returns 5
FOREACH
Constructs an array by applying <expr> to each item in <array_range>.
Syntax
FOREACH(<item>, <array_range>, <expr>)
Example
V NewSales[10] = FOREACH(item, 10, item * 10)
# returns {10, 20, 30, 40, 50, 60, 70, 80, 90, 100}
INDEXMAX
Index of the largest element. For multidimensional arrays, specify <dimension>.
Syntax
INDEXMAX(<array>, <dimension>)
Example
V MaxLoc = INDEXMAX({34, 78, 50, 67}) # returns 2
INDEXMIN
Index of the smallest element. For multidimensional arrays, specify <dimension>.
Syntax
INDEXMIN(<array>, <dimension>)
INDEXOF
Index of <findval> in a vector, or NaN if not found.
Syntax
INDEXOF(<findval>, <vector>, <startindex>)
INDEXGT
Index of first element greater than <findval>.
Syntax
INDEXGT(<findval>, <vector>, <startindex>)
INDEXGTEQ
Index of first element greater than or equal to <findval>.
Syntax
INDEXGTEQ(<findval>, <vector>, <startindex>)
INDEXLT
Index of first element less than <findval>.
Syntax
INDEXLT(<findval>, <vector>, <startindex>)
INDEXLTEQ
Index of first element less than or equal to <findval>.
Syntax
INDEXLTEQ(<findval>, <vector>, <startindex>)
INDEXNEQ
Index of first element not equal to <findval>.
Syntax
INDEXNEQ(<findval>, <vector>, <startindex>)
LAST
Returns the last index or enumerated item in a range.
Syntax
LAST(<rangename>)
Example
R Array Range = 5..27
V Last Element = LAST(Array Range) # returns 27
MATRIXINVERT
Inversion of a square matrix.
Syntax
MATRIXINVERT(<squarematrix>)
MATRIXPRODUCT
Product of two 2D matrices. If <matrix1> is m×n and <matrix2> is n×p, result is m×p.
Syntax
MATRIXPRODUCT(<matrix1>, <matrix2>)
MATRIXTRANSPOSE
Transposes a 2D matrix.
Syntax
MATRIXTRANSPOSE(<matrix>)
RANGECOUNT
Number of elements in a range.
Syntax
RANGECOUNT(<rangename>)
Example
R Array Range = 5..27
V Count = RANGECOUNT(Array Range) # returns 23
Miscellaneous functions
AVG
Average of a list of arguments.
Syntax
AVG(<expr1>, <expr2>, ...)
Example
V Average = AVG(0, 10, 90, 100) # returns 50
BETADIST
Cumulative beta probability density function.
Syntax
BETADIST(<x>, <alpha>, <beta>)
BETAINV
Inverse of the cumulative beta probability density.
Syntax
BETAINV(<probability>, <alpha>, <beta>)
BINOMDIST
Individual term binomial distribution probability. <cumulative> 1 = cumulative, 0 = density.
Syntax
BINOMDIST(<number_s>, <trials>, <probability_s>, <cumulative>)
EXPONDIST
Exponential distribution. <cumulative> 1 = cumulative, 0 = density.
Syntax
EXPONDIST(<x>, <lambda>, <cumulative>)
EXPRND
Random number from an exponential distribution with mean <lambda> (default 1).
Syntax
EXPRND(<lambda>)
FDIST
F probability distribution.
Syntax
FDIST(<x>, <degrees_freedom1>, <degrees_freedom2>)
FINV
Inverse of the F probability distribution.
Syntax
FINV(<probability>, <degrees_freedom1>, <degrees_freedom2>)
GAMMADIST
Gamma distribution. <cumulative> 1 = cumulative, 0 = density.
Syntax
GAMMADIST(<x>, <alpha>, <beta>, <cumulative>)
GAMMAINV
Inverse of the cumulative gamma distribution.
Syntax
GAMMAINV(<probability>, <alpha>, <beta>)
GRAPH
Lookup with linear interpolation from equally spaced values. Arguments are passed individually (not as an array).
Syntax
GRAPH(<input>, <startx>, <intervalx>, <outval1>, <outval2>, ...)
Example
V Result = GRAPH(STEP, 0, 2, 10, 30, 0)
# Step 0: 10, Step 1: 20, Step 2: 30, Step 3: 15
GRAPHSTEP
Lookup without interpolation from equally spaced values.
Syntax
GRAPHSTEP(<input>, <startx>, <intervalx>, <outval1>, <outval2>, ...)
HYPGEOMDIST
Hypergeometric distribution.
Syntax
HYPGEOMDIST(<sample_s>, <number_sample>, <population_s>, <number_population>)
LIMITFLOW
Adjusts a flow to keep one or two stocks non-negative. Use in conjunction with STOCK(..., NONNEGATIVE).
Syntax
LIMITFLOW(<flowexpr>, <stock1>, <stock2>)
Example
V Factory Inventory = STOCK(-Shipments, 1000)
V Warehouse Inventory = STOCK(Shipments, 0)
V Shipments = LIMITFLOW(600, Factory Inventory, Warehouse Inventory)
LOGINV
Inverse of the lognormal cumulative distribution.
Syntax
LOGINV(<probability>, <mean>, <standard_dev>)
LOGNORMAL
Random number from a log-normal distribution.
Syntax
LOGNORMAL(<mean>, <standard_dev>, <seed>)
LOGNORMDIST
Cumulative lognormal distribution.
Syntax
LOGNORMDIST(<x>, <mean>, <standard_dev>)
LOOKUP
Returns a value by 0-based index. If index exceeds the list, returns the last value.
Syntax
LOOKUP(<input>, <val1>, <val2>, ...)
Example
V Result = LOOKUP(STEP, 10, 30, 0, 50)
# Step 0: 10, Step 1: 30, Step 2: 0, Step 3: 50
MAX
Highest value in a list of arguments.
Syntax
MAX(<expr1>, <expr2>, ...)
Example
V Highest = MAX(100, -5, 300, 0) # returns 300
MIN
Lowest value in a list of arguments.
Syntax
MIN(<expr1>, <expr2>, ...)
Example
V Lowest = MIN(100, -5, 300, 0) # returns -5
NORMAL
Random number from a standard normal distribution (mean 0, std dev 1). Optional <seed> for reproducibility.
Syntax
NORMAL(<seed>)
NORMDIST
Normal distribution. <cumulative> 1 = cumulative, 0 = density.
Syntax
NORMDIST(<x>, <mean>, <standard_dev>, <cumulative>)
NORMSDIST
Standard normal cumulative distribution (mean 0, std dev 1).
Syntax
NORMSDIST(<z>)
NORMINV
Inverse of the normal cumulative distribution.
Syntax
NORMINV(<probability>, <mean>, <standard_dev>)
POISSON
Random integer from a Poisson distribution with mean <mean>.
Syntax
POISSON(<mean>, <seed>)
RAND
Random number between 0 and 1.
Syntax
RAND(<seed>)
RANDBETWEEN
Random number between <bottomvalue> and <topvalue>.
Syntax
RANDBETWEEN(<bottomvalue>, <topvalue>, <seed>)
STDDEV
Standard deviation of a list of arguments (equivalent to Excel's STDEVP).
Syntax
STDDEV(<expr1>, <expr2>, ...)
Example
V StdDev = STDDEV(0, 10, 90, 100) # returns 45.27
SUM
Sum of a list of arguments.
Syntax
SUM(<expr1>, <expr2>, ...)
Example
V Total = SUM(0, 10, 90, 100) # returns 200
TDIST
One-tailed Student t-distribution percentage points.
Syntax
TDIST(<x>, <degrees_freedom>)
TINV
One-tailed t-value of the t-distribution.
Syntax
TINV(<probability>, <degrees_freedom>)