> For the complete documentation index, see [llms.txt](https://help.alldrafts.com/alldrafts-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.alldrafts.com/alldrafts-documentation/fields/formula-functions.md).

# Formula Functions

The formulas work like Excel and Google Sheets, and examples you find on the Internet will generally work in AllDrafts' [calculated fields](/alldrafts-documentation/fields/calculated-fields.md) with little or no modification as lon gas you use field names instead of row-column references. (AllDrafts has no sense of cell D23, but may have a field named `Interest Rate`, which you can refer to in a formula by using the underscore (\_) character for spaces, like `Interest_Rate`.)

Ultimately AllDrafts renders everything as text, but if a formula results in a number or date, AllDrafts will use the field's formatting property to render it.

### ALLDRAFTS-ONLY FUNCTIONS

<table><thead><tr><th width="177">Function</th><th width="337">Example call</th><th>Expected result</th></tr></thead><tbody><tr><td><a href="/pages/OCexegubpSFyxnpggOfw"><code>ARTICLEFOR</code></a></td><td><code>ARTICLEFOR("certificate")</code></td><td>a</td></tr><tr><td><code>CAPITALIZE</code></td><td><code>CAPITALIZE("certificate")</code></td><td>Certificate</td></tr><tr><td><code>IFSINGULAR</code></td><td><code>IFSINGULAR("employees", "one", "multiple")</code></td><td>multiple</td></tr><tr><td><code>PLURAL</code></td><td><code>PLURAL("certificate", 2)</code></td><td>certificates</td></tr><tr><td><code>PLURALPOSSESSIVE</code></td><td><code>PLURALPOSSESSIVE("owner", 2)</code></td><td>owners'</td></tr><tr><td><code>PRONOUNFOR</code></td><td><code>PRONOUNFOR("John Doe", "subjective")</code></td><td>he</td></tr><tr><td><code>TITLE</code></td><td><code>TITLE()</code><br><em>in a document titled Employment Agreement</em></td><td>Employment Agreement</td></tr><tr><td><a href="/pages/qsQQ2hP6OcHjADVTcLWs"><code>USHOLIDAYS</code></a></td><td><code>=WORKDAY(Start_Date, 30, USHOLIDAYS())</code></td><td><em>The work day 30 days after Start_Date, excluding weekends and US holidays.</em></td></tr></tbody></table>

### DATE

<table><thead><tr><th width="177">Function</th><th width="337">Example call</th><th>Expected result</th></tr></thead><tbody><tr><td><code>DATE</code></td><td><code>DATE(2008, 7, 8)</code></td><td>Tue Jul 08 2008 00:00:00 GMT-0700 (PDT)</td></tr><tr><td><code>DATEVALUE</code></td><td><code>DATEVALUE("8/22/2011")</code></td><td>Mon Aug 22 2011 00:00:00 GMT-0700 (PDT)</td></tr><tr><td><code>DAY</code></td><td><code>DAY("15-Apr-11")</code></td><td>15</td></tr><tr><td><code>DAYS</code></td><td><code>DAYS("3/15/11", "2/1/11")</code></td><td>42</td></tr><tr><td><code>DAYS360</code></td><td><code>DAYS360("1-Jan-11", "31-Dec-11")</code></td><td>360</td></tr><tr><td><code>EDATE</code></td><td><code>EDATE("1/15/11", -1)</code></td><td>Wed Dec 15 2010 00:00:00 GMT-0800 (PST)</td></tr><tr><td><code>EOMONTH</code></td><td><code>EOMONTH("1/1/11", -3)</code></td><td>Sun Oct 31 2010 00:00:00 GMT-0700 (PDT)</td></tr><tr><td><code>HOUR</code></td><td><code>HOUR("7/18/2011 7:45:00 AM")</code></td><td>7</td></tr><tr><td><code>MINUTE</code></td><td><code>MINUTE("2/1/2011 12:45:00 PM")</code></td><td>45</td></tr><tr><td><code>ISOWEEKNUM</code></td><td><code>ISOWEEKNUM("3/9/2012")</code></td><td>10</td></tr><tr><td><code>MONTH</code></td><td><code>MONTH("15-Apr-11")</code></td><td>4</td></tr><tr><td><code>NETWORKDAYS</code></td><td><code>NETWORKDAYS("10/1/2012", "3/1/2013", {"11/22/2012"})</code></td><td>109</td></tr><tr><td><code>NETWORKDAYSINTL</code></td><td><code>NETWORKDAYSINTL("1/1/2006", "2/1/2006", 7, {"1/2/2006"})</code></td><td>23</td></tr><tr><td><code>NOW</code></td><td><code>NOW()</code></td><td>Thu Feb 20 2020 23:02:55 GMT+0100 (Central European Standard Time)</td></tr><tr><td><code>SECOND</code></td><td><code>SECOND("2/1/2011 4:48:18 PM")</code></td><td>18</td></tr><tr><td><code>TIME</code></td><td><code>TIME(16, 48, 10)</code></td><td>0.7001157407407408</td></tr><tr><td><code>TIMEVALUE</code></td><td><code>TIMEVALUE("22-Aug-2011 6:35 AM")</code></td><td>0.2743055555555556</td></tr><tr><td><code>TODAY</code></td><td><code>TODAY()</code></td><td>Thu Feb 20 2020 23:02:55 GMT+0100 (Central European Standard Time)</td></tr><tr><td><code>WEEKDAY</code></td><td><code>WEEKDAY("2/14/2008", 3)</code></td><td>3</td></tr><tr><td><code>YEAR</code></td><td><code>YEAR("7/5/2008")</code></td><td>2008</td></tr><tr><td><code>WEEKNUM</code></td><td><code>WEEKNUM("3/9/2012", 2)</code></td><td>11</td></tr><tr><td><code>WORKDAY</code></td><td><code>WORKDAY("10/1/2008", 151, {"11/26/2008", "12/4/2008"})</code></td><td>Mon May 04 2009 00:00:00 GMT-0700 (PDT)</td></tr><tr><td><code>WORKDAYINTL</code></td><td><code>WORKDAYINTL("1/1/2012", 30, 17)</code></td><td>Sun Feb 05 2012 00:00:00 GMT-0800 (PST)</td></tr><tr><td><code>YEARFRAC</code></td><td><code>YEARFRAC("1/1/2012", "7/30/2012", 3)</code></td><td>0.5780821917808219</td></tr></tbody></table>

### FINANCIAL

<table><thead><tr><th width="178">Function</th><th width="332">Example call</th><th>Expected result</th></tr></thead><tbody><tr><td><code>ACCRINT</code></td><td><code>ACCRINT("01/01/2011", "02/01/2011", "07/01/2014", 0.1, 1000, 1, 0)</code></td><td>350</td></tr><tr><td><code>CUMIPMT</code></td><td><code>CUMIPMT(0.1/12, 30*12, 100000, 13, 24, 0)</code></td><td>-9916.77251395708</td></tr><tr><td><code>CUMPRINC</code></td><td><code>CUMPRINC(0.1/12, 30*12, 100000, 13, 24, 0)</code></td><td>-614.0863271085149</td></tr><tr><td><code>DB</code></td><td><code>DB(1000000, 100000, 6, 1, 6)</code></td><td>159500</td></tr><tr><td><code>DDB</code></td><td><code>DDB(1000000, 100000, 6, 1, 1.5)</code></td><td>250000</td></tr><tr><td><code>DOLLARDE</code></td><td><code>DOLLARDE(1.1, 16)</code></td><td>1.625</td></tr><tr><td><code>DOLLARFR</code></td><td><code>DOLLARFR(1.625, 16)</code></td><td>1.1</td></tr><tr><td><code>EFFECT</code></td><td><code>EFFECT(0.1, 4)</code></td><td>0.10381289062499977</td></tr><tr><td><code>FV</code></td><td><code>FV(0.1/12, 10, -100, -1000, 0)</code></td><td>2124.874409194097</td></tr><tr><td><code>FVSCHEDULE</code></td><td><code>FVSCHEDULE(100, {0.09,0.1,0.11})</code></td><td>133.08900000000003</td></tr><tr><td><code>IPMT</code></td><td><code>IPMT(0.1/12, 6, 2*12, 100000, 1000000, 0)</code></td><td>928.8235718400465</td></tr><tr><td><code>IRR</code></td><td><code>IRR({-75000,12000,15000,18000,21000,24000}, 0.075)</code></td><td>0.05715142887178447</td></tr><tr><td><code>ISPMT</code></td><td><code>ISPMT(0.1/12, 6, 2*12, 100000)</code></td><td>-625</td></tr><tr><td><code>MIRR</code></td><td><code>MIRR({-75000,12000,15000,18000,21000,24000}, 0.1, 0.12)</code></td><td>0.07971710360838036</td></tr><tr><td><code>NOMINAL</code></td><td><code>NOMINAL(0.1, 4)</code></td><td>0.09645475633778045</td></tr><tr><td><code>NPER</code></td><td><code>NPER(0.1/12, -100, -1000, 10000, 0)</code></td><td>63.39385422740764</td></tr><tr><td><code>NPV</code></td><td><code>NPV(0.1, -10000, 2000, 4000, 8000)</code></td><td>1031.3503176012546</td></tr><tr><td><code>PDURATION</code></td><td><code>PDURATION(0.1, 1000, 2000)</code></td><td>7.272540897341714</td></tr><tr><td><code>PMT</code></td><td><code>PMT(0.1/12, 2*12, 100000, 1000000, 0)</code></td><td>-42426.08563793503</td></tr><tr><td><code>PPMT</code></td><td><code>PPMT(0.1/12, 6, 2*12, 100000, 1000000, 0)</code></td><td>-43354.909209775076</td></tr><tr><td><code>PV</code></td><td><code>PV(0.1/12, 2*12, 1000, 10000, 0)</code></td><td>-29864.950264779152</td></tr><tr><td><code>RATE</code></td><td><code>RATE(2*12, -1000, -10000, 100000, 0, 0.1)</code></td><td>0.06517891177181533</td></tr></tbody></table>

### ENGINEERING

<table><thead><tr><th width="174">Function</th><th width="336">Example call</th><th>Expected result</th></tr></thead><tbody><tr><td><code>BIN2DEC</code></td><td><code>BIN2DEC(101010)</code></td><td>42</td></tr><tr><td><code>BIN2HEX</code></td><td><code>BIN2HEX(101010)</code></td><td>2a</td></tr><tr><td><code>BIN2OCT</code></td><td><code>BIN2OCT(101010)</code></td><td>52</td></tr><tr><td><code>BITAND</code></td><td><code>BITAND(42, 24)</code></td><td>8</td></tr><tr><td><code>BITLSHIFT</code></td><td><code>BITLSHIFT(42, 24)</code></td><td>704643072</td></tr><tr><td><code>BITOR</code></td><td><code>BITOR(42, 24)</code></td><td>58</td></tr><tr><td><code>BITRSHIFT</code></td><td><code>BITRSHIFT(42, 2)</code></td><td>10</td></tr><tr><td><code>BITXOR</code></td><td><code>BITXOR(42, 24)</code></td><td>50</td></tr><tr><td><code>COMPLEX</code></td><td><code>COMPLEX(3, 4)</code></td><td>3+4i</td></tr><tr><td><code>CONVERT</code></td><td><code>CONVERT(64, "kibyte", "bit")</code></td><td>524288</td></tr><tr><td><code>DEC2BIN</code></td><td><code>DEC2BIN(42)</code></td><td>101010</td></tr><tr><td><code>DEC2HEX</code></td><td><code>DEC2HEX(42)</code></td><td>2a</td></tr><tr><td><code>DEC2OCT</code></td><td><code>DEC2OCT(42)</code></td><td>52</td></tr><tr><td><code>DELTA</code></td><td><code>DELTA(42, 42)</code></td><td>1</td></tr><tr><td><code>ERF</code></td><td><code>ERF(1)</code></td><td>0.8427007929497149</td></tr><tr><td><code>ERFC</code></td><td><code>ERFC(1)</code></td><td>0.1572992070502851</td></tr><tr><td><code>GESTEP</code></td><td><code>GESTEP(42, 24)</code></td><td>1</td></tr><tr><td><code>HEX2BIN</code></td><td><code>HEX2BIN("2a")</code></td><td>101010</td></tr><tr><td><code>HEX2DEC</code></td><td><code>HEX2DEC("2a")</code></td><td>42</td></tr><tr><td><code>HEX2OCT</code></td><td><code>HEX2OCT("2a")</code></td><td>52</td></tr><tr><td><code>IMABS</code></td><td><code>IMABS("3+4i")</code></td><td>5</td></tr><tr><td><code>IMAGINARY</code></td><td><code>IMAGINARY("3+4i")</code></td><td>4</td></tr><tr><td><code>IMARGUMENT</code></td><td><code>IMARGUMENT("3+4i")</code></td><td>0.9272952180016122</td></tr><tr><td><code>IMCONJUGATE</code></td><td><code>IMCONJUGATE("3+4i")</code></td><td>3-4i</td></tr><tr><td><code>IMCOS</code></td><td><code>IMCOS("1+i")</code></td><td>0.8337300251311491-0.9888977057628651i</td></tr><tr><td><code>IMCOSH</code></td><td><code>IMCOSH("1+i")</code></td><td>0.8337300251311491+0.9888977057628651i</td></tr><tr><td><code>IMCOT</code></td><td><code>IMCOT("1+i")</code></td><td>0.21762156185440265-0.8680141428959249i</td></tr><tr><td><code>IMCSC</code></td><td><code>IMCSC("1+i")</code></td><td>0.6215180171704283-0.3039310016284264i</td></tr><tr><td><code>IMCSCH</code></td><td><code>IMCSCH("1+i")</code></td><td>0.3039310016284264-0.6215180171704283i</td></tr><tr><td><code>IMDIV</code></td><td><code>IMDIV("1+2i", "3+4i")</code></td><td>0.44+0.08i</td></tr><tr><td><code>IMEXP</code></td><td><code>IMEXP("1+i")</code></td><td>1.4686939399158851+2.2873552871788423i</td></tr><tr><td><code>IMLN</code></td><td><code>IMLN("1+i")</code></td><td>0.3465735902799727+0.7853981633974483i</td></tr><tr><td><code>IMLOG10</code></td><td><code>IMLOG10("1+i")</code></td><td>0.1505149978319906+0.3410940884604603i</td></tr><tr><td><code>IMLOG2</code></td><td><code>IMLOG2("1+i")</code></td><td>0.5000000000000001+1.1330900354567985i</td></tr><tr><td><code>IMPOWER</code></td><td><code>IMPOWER("1+i", 2)</code></td><td>1.2246063538223775e-16+2.0000000000000004i</td></tr><tr><td><code>IMPRODUCT</code></td><td><code>IMPRODUCT("1+2i", "3+4i", "5+6i")</code></td><td>-85+20i</td></tr><tr><td><code>IMREAL</code></td><td><code>IMREAL("3+4i")</code></td><td>3</td></tr><tr><td><code>IMSEC</code></td><td><code>IMSEC("1+i")</code></td><td>0.4983370305551868+0.591083841721045i</td></tr><tr><td><code>IMSECH</code></td><td><code>IMSECH("1+i")</code></td><td>0.4983370305551868-0.591083841721045i</td></tr><tr><td><code>IMSIN</code></td><td><code>IMSIN("1+i")</code></td><td>1.2984575814159773+0.6349639147847361i</td></tr><tr><td><code>IMSINH</code></td><td><code>IMSINH("1+i")</code></td><td>0.6349639147847361+1.2984575814159773i</td></tr><tr><td><code>IMSQRT</code></td><td><code>IMSQRT("1+i")</code></td><td>1.0986841134678098+0.45508986056222733i</td></tr><tr><td><code>IMSUB</code></td><td><code>IMSUB("3+4i", "1+2i")</code></td><td>2+2i</td></tr><tr><td><code>IMSUM</code></td><td><code>IMSUM("1+2i", "3+4i", "5+6i")</code></td><td>9+12i</td></tr><tr><td><code>IMTAN</code></td><td><code>IMTAN("1+i")</code></td><td>0.2717525853195117+1.0839233273386946i</td></tr><tr><td><code>OCT2BIN</code></td><td><code>OCT2BIN("52")</code></td><td>101010</td></tr><tr><td><code>OCT2DEC</code></td><td><code>OCT2DEC("52")</code></td><td>42</td></tr><tr><td><code>OCT2HEX</code></td><td><code>OCT2HEX("52")</code></td><td>2a</td></tr></tbody></table>

### LOGICAL

<table><thead><tr><th width="179">Function</th><th width="329">Example call</th><th>Expected result</th></tr></thead><tbody><tr><td><code>AND</code></td><td><code>AND(true, false, true)</code></td><td>false</td></tr><tr><td><code>false</code></td><td><code>FALSE()</code></td><td>false</td></tr><tr><td><code>IF</code></td><td><code>IF(true, "Hello!", "Goodbye!")</code></td><td>Hello!</td></tr><tr><td><code>IFS</code></td><td><code>IFS(false, "Hello!", true, "Goodbye!")</code></td><td>Goodbye!</td></tr><tr><td><code>IFERROR</code></td><td><code>IFERROR("#DIV/0!", "Error")</code></td><td>Error</td></tr><tr><td><code>IFNA</code></td><td><code>IFNA("#N/A", "Error")</code></td><td>Error</td></tr><tr><td><code>NOT</code></td><td><code>NOT(true)</code></td><td>false</td></tr><tr><td><code>OR</code></td><td><code>OR(true, false, true)</code></td><td>true</td></tr><tr><td><code>SWITCH</code></td><td><code>SWITCH(7, 9, "Nine", 7, "Seven")</code></td><td>Seven</td></tr><tr><td><code>true</code></td><td><code>TRUE()</code></td><td>true</td></tr><tr><td><code>XOR</code></td><td><code>XOR(true, false, true)</code></td><td>false</td></tr><tr><td><code>CHOOSE</code></td><td><code>CHOOSE(2, "red", "blue", "green")</code></td><td>blue</td></tr></tbody></table>

### MATH

<table><thead><tr><th width="191">Function</th><th width="342">Example call</th><th>Expected result</th></tr></thead><tbody><tr><td><code>ABS</code></td><td><code>ABS(-4)</code></td><td>4</td></tr><tr><td><code>ACOS</code></td><td><code>ACOS(-0.5)</code></td><td>2.0943951023931957</td></tr><tr><td><code>ACOSH</code></td><td><code>ACOSH(10)</code></td><td>2.993222846126381</td></tr><tr><td><code>ACOT</code></td><td><code>ACOT(2)</code></td><td>0.46364760900080615</td></tr><tr><td><code>ACOTH</code></td><td><code>ACOTH(6)</code></td><td>0.16823611831060645</td></tr><tr><td><code>AGGREGATE</code></td><td><code>AGGREGATE(9, 4, {-5,15}, {32,"Hello World!"})</code></td><td>10,32</td></tr><tr><td><code>ARABIC</code></td><td><code>ARABIC("MCMXII")</code></td><td>1912</td></tr><tr><td><code>ASIN</code></td><td><code>ASIN(-0.5)</code></td><td>-0.5235987755982988</td></tr><tr><td><code>ASINH</code></td><td><code>ASINH(-2.5)</code></td><td>-1.6472311463710965</td></tr><tr><td><code>ATAN</code></td><td><code>ATAN(1)</code></td><td>0.7853981633974483</td></tr><tr><td><code>ATAN2</code></td><td><code>ATAN2(-1, -1)</code></td><td>-2.356194490192345</td></tr><tr><td><code>ATANH</code></td><td><code>ATANH(-0.1)</code></td><td>-0.10033534773107562</td></tr><tr><td><code>BASE</code></td><td><code>BASE(15, 2, 10)</code></td><td>0000001111</td></tr><tr><td><code>CEILING</code></td><td><code>CEILING(-5.5, 2, -1)</code></td><td>-6</td></tr><tr><td><code>CEILINGMATH</code></td><td><code>CEILINGMATH(-5.5, 2, -1)</code></td><td>-6</td></tr><tr><td><code>CEILINGPRECISE</code></td><td><code>CEILINGPRECISE(-4.1, -2)</code></td><td>-4</td></tr><tr><td><code>COMBIN</code></td><td><code>COMBIN(8, 2)</code></td><td>28</td></tr><tr><td><code>COMBINA</code></td><td><code>COMBINA(4, 3)</code></td><td>20</td></tr><tr><td><code>COS</code></td><td><code>COS(1)</code></td><td>0.5403023058681398</td></tr><tr><td><code>COSH</code></td><td><code>COSH(1)</code></td><td>1.5430806348152437</td></tr><tr><td><code>COT</code></td><td><code>COT(30)</code></td><td>-0.15611995216165922</td></tr><tr><td><code>COTH</code></td><td><code>COTH(2)</code></td><td>1.0373147207275482</td></tr><tr><td><code>CSC</code></td><td><code>CSC(15)</code></td><td>1.5377805615408537</td></tr><tr><td><code>CSCH</code></td><td><code>CSCH(1.5)</code></td><td>0.46964244059522464</td></tr><tr><td><code>DECIMAL</code></td><td><code>DECIMAL("FF", 16)</code></td><td>255</td></tr><tr><td><code>ERF</code></td><td><code>ERF(1)</code></td><td>0.8427007929497149</td></tr><tr><td><code>ERFC</code></td><td><code>ERFC(1)</code></td><td>0.1572992070502851</td></tr><tr><td><code>EVEN</code></td><td><code>EVEN(-1)</code></td><td>-2</td></tr><tr><td><code>EXP</code></td><td><code>EXP(1)</code></td><td>2.718281828459045</td></tr><tr><td><code>FACT</code></td><td><code>FACT(5)</code></td><td>120</td></tr><tr><td><code>FACTDOUBLE</code></td><td><code>FACTDOUBLE(7)</code></td><td>105</td></tr><tr><td><code>FLOOR</code></td><td><code>FLOOR(-3.1)</code></td><td>-4</td></tr><tr><td><code>FLOORMATH</code></td><td><code>FLOORMATH(-4.1, -2, -1)</code></td><td>-4</td></tr><tr><td><code>FLOORPRECISE</code></td><td><code>FLOORPRECISE(-3.1, -2)</code></td><td>-4</td></tr><tr><td><code>GCD</code></td><td><code>GCD(24, 36, 48)</code></td><td>12</td></tr><tr><td><code>INT</code></td><td><code>INT(-8.9)</code></td><td>-9</td></tr><tr><td><code>ISEVEN</code></td><td><code>ISEVEN(-2.5)</code></td><td>true</td></tr><tr><td><code>ISOCEILING</code></td><td><code>ISOCEILING(-4.1, -2)</code></td><td>-4</td></tr><tr><td><code>ISODD</code></td><td><code>ISODD(-2.5)</code></td><td>false</td></tr><tr><td><code>LCM</code></td><td><code>LCM(24, 36, 48)</code></td><td>144</td></tr><tr><td><code>LN</code></td><td><code>LN(86)</code></td><td>4.454347296253507</td></tr><tr><td><code>LOG</code></td><td><code>LOG(8, 2)</code></td><td>3</td></tr><tr><td><code>LOG10</code></td><td><code>LOG10(100000)</code></td><td>5</td></tr><tr><td><code>MOD</code></td><td><code>MOD(3, -2)</code></td><td>-1</td></tr><tr><td><code>MROUND</code></td><td><code>MROUND(-10, -3)</code></td><td>-9</td></tr><tr><td><code>MULTINOMIAL</code></td><td><code>MULTINOMIAL(2, 3, 4)</code></td><td>1260</td></tr><tr><td><code>ODD</code></td><td><code>ODD(-1.5)</code></td><td>-3</td></tr><tr><td><code>POWER</code></td><td><code>POWER(5, 2)</code></td><td>25</td></tr><tr><td><code>PRODUCT</code></td><td><code>PRODUCT(5, 15, 30)</code></td><td>2250</td></tr><tr><td><code>QUOTIENT</code></td><td><code>QUOTIENT(-10, 3)</code></td><td>-3</td></tr><tr><td><code>RADIANS</code></td><td><code>RADIANS(180)</code></td><td>3.141592653589793</td></tr><tr><td><code>RAND</code></td><td><code>RAND()</code></td><td>[Random real number greater between 0 and 1]</td></tr><tr><td><code>RANDBETWEEN</code></td><td><code>RANDBETWEEN(-1, 1)</code></td><td>[Random integer between bottom and top]</td></tr><tr><td><code>ROUND</code></td><td><code>ROUND(626.3, -3)</code></td><td>1000</td></tr><tr><td><code>ROUNDDOWN</code></td><td><code>ROUNDDOWN(-3.14159, 2)</code></td><td>-3.14</td></tr><tr><td><code>ROUNDUP</code></td><td><code>ROUNDUP(-3.14159, 2)</code></td><td>-3.15</td></tr><tr><td><code>SEC</code></td><td><code>SEC(45)</code></td><td>1.9035944074044246</td></tr><tr><td><code>SECH</code></td><td><code>SECH(45)</code></td><td>5.725037161098787e-20</td></tr><tr><td><code>SIGN</code></td><td><code>SIGN(-0.00001)</code></td><td>-1</td></tr><tr><td><code>SIN</code></td><td><code>SIN(1)</code></td><td>0.8414709848078965</td></tr><tr><td><code>SINH</code></td><td><code>SINH(1)</code></td><td>1.1752011936438014</td></tr><tr><td><code>SQRT</code></td><td><code>SQRT(16)</code></td><td>4</td></tr><tr><td><code>SQRTPI</code></td><td><code>SQRTPI(2)</code></td><td>2.5066282746310002</td></tr><tr><td><code>SUBTOTAL</code></td><td><code>SUBTOTAL(9, {-5,15}, {32,"Hello World!"})</code></td><td>10,32</td></tr><tr><td><code>SUM</code></td><td><code>SUM(-5, 15, 32, "Hello World!")</code></td><td>42</td></tr><tr><td><code>SUMIF</code></td><td><code>SUMIF({2,4,8,16}, ">5")</code></td><td>24</td></tr><tr><td><code>SUMIFS</code></td><td><code>SUMIFS({2,4,8,16}, {1,2,3,4}, ">=2", {1,2,4,8}, "&#x3C;=4")</code></td><td>12</td></tr><tr><td><code>SUMPRODUCT</code></td><td><code>SUMPRODUCT({{1,2},{3,4}}, {{1,0},{0,1}})</code></td><td>5</td></tr><tr><td><code>SUMSQ</code></td><td><code>SUMSQ(3, 4)</code></td><td>25</td></tr><tr><td><code>SUMX2MY2</code></td><td><code>SUMX2MY2({1,2}, {3,4})</code></td><td>-20</td></tr><tr><td><code>SUMX2PY2</code></td><td><code>SUMX2PY2({1,2}, {3,4})</code></td><td>30</td></tr><tr><td><code>SUMXMY2</code></td><td><code>SUMXMY2({1,2}, {3,4})</code></td><td>8</td></tr><tr><td><code>TAN</code></td><td><code>TAN(1)</code></td><td>1.5574077246549023</td></tr><tr><td><code>TANH</code></td><td><code>TANH(-2)</code></td><td>-0.9640275800758168</td></tr><tr><td><code>TRUNC</code></td><td><code>TRUNC(-8.9)</code></td><td>-8</td></tr></tbody></table>

### STATISTICAL

<table><thead><tr><th width="186">Function</th><th width="350">Example call</th><th>Expected result</th></tr></thead><tbody><tr><td><code>AVEDEV</code></td><td><code>AVEDEV({2,4}, {8,16})</code></td><td>4.5</td></tr><tr><td><code>AVERAGE</code></td><td><code>AVERAGE({2,4}, {8,16})</code></td><td>7.5</td></tr><tr><td><code>AVERAGEA</code></td><td><code>AVERAGEA({2,4}, {8,16})</code></td><td>7.5</td></tr><tr><td><code>AVERAGEIF</code></td><td><code>AVERAGEIF({2,4,8,16}, ">5", {1, 2, 3, 4})</code></td><td>3.5</td></tr><tr><td><code>AVERAGEIFS</code></td><td><code>AVERAGEIFS({2,4,8,16}, {1,2,3,4}, ">=2", {1,2,4,8}, "&#x3C;=4")</code></td><td>6</td></tr><tr><td><code>BETADIST</code></td><td><code>BETADIST(2, 8, 10, true, 1, 3)</code></td><td>0.6854705810117458</td></tr><tr><td><code>BETAINV</code></td><td><code>BETAINV(0.6854705810117458, 8, 10, 1, 3)</code></td><td>1.9999999999999998</td></tr><tr><td><code>BINOMDIST</code></td><td><code>BINOMDIST(6, 10, 0.5, false)</code></td><td>0.205078125</td></tr><tr><td><code>CORREL</code></td><td><code>CORREL({3,2,4,5,6}, {9,7,12,15,17})</code></td><td>0.9970544855015815</td></tr><tr><td><code>COUNT</code></td><td><code>COUNT({1,2}, {3,4})</code></td><td>4</td></tr><tr><td><code>COUNTA</code></td><td><code>COUNTA({1, null, 3, "a", "", "c"})</code></td><td>4</td></tr><tr><td><code>COUNTBLANK</code></td><td><code>COUNTBLANK({1, null, 3, "a", "", "c"})</code></td><td>2</td></tr><tr><td><code>COUNTIF</code></td><td><code>COUNTIF({"Caen", "Melbourne", "Palo Alto", "Singapore"}, "a")</code></td><td>3</td></tr><tr><td><code>COUNTIFS</code></td><td><code>COUNTIFS({2,4,8,16}, {1,2,3,4}, ">=2", {1,2,4,8}, "&#x3C;=4")</code></td><td>2</td></tr><tr><td><code>COUNTUNIQUE</code></td><td><code>COUNTUNIQUE({1,1,2,2,3,3})</code></td><td>3</td></tr><tr><td><code>COVARIANCEP</code></td><td><code>COVARIANCEP({3,2,4,5,6}, {9,7,12,15,17})</code></td><td>5.2</td></tr><tr><td><code>COVARIANCES</code></td><td><code>COVARIANCES({2,4,8}, {5,11,12})</code></td><td>9.666666666666668</td></tr><tr><td><code>DEVSQ</code></td><td><code>DEVSQ({2,4,8,16})</code></td><td>115</td></tr><tr><td><code>EXPONDIST</code></td><td><code>EXPONDIST(0.2, 10, true)</code></td><td>0.8646647167633873</td></tr><tr><td><code>FDIST</code></td><td><code>FDIST(15.2069, 6, 4, false)</code></td><td>0.0012237917087831735</td></tr><tr><td><code>FINV</code></td><td><code>FINV(0.01, 6, 4)</code></td><td>0.10930991412457851</td></tr><tr><td><code>FISHER</code></td><td><code>FISHER(0.75)</code></td><td>0.9729550745276566</td></tr><tr><td><code>FISHERINV</code></td><td><code>FISHERINV(0.9729550745276566)</code></td><td>0.75</td></tr><tr><td><code>FORECAST</code></td><td><code>FORECAST(30, {6,7,9,15,21}, {20,28,31,38,40})</code></td><td>10.607253086419755</td></tr><tr><td><code>FREQUENCY</code></td><td><code>FREQUENCY({79,85,78,85,50,81,95,88,97}, {70,79,89})</code></td><td>1,2,4,2</td></tr><tr><td><code>GAMMA</code></td><td><code>GAMMA(2.5)</code></td><td>1.3293403919101043</td></tr><tr><td><code>GAMMALN</code></td><td><code>GAMMALN(10)</code></td><td>12.801827480081961</td></tr><tr><td><code>GAUSS</code></td><td><code>GAUSS(2)</code></td><td>0.4772498680518208</td></tr><tr><td><code>GEOMEAN</code></td><td><code>GEOMEAN({2,4}, {8,16})</code></td><td>5.656854249492381</td></tr><tr><td><code>GROWTH</code></td><td><code>GROWTH({2,4,8,16}, {1,2,3,4}, {5})</code></td><td>32.00000000000003</td></tr><tr><td><code>HARMEAN</code></td><td><code>HARMEAN({2,4}, {8,16})</code></td><td>4.266666666666667</td></tr><tr><td><code>HYPGEOMDIST</code></td><td><code>HYPGEOMDIST(1, 4, 8, 20, false)</code></td><td>0.3632610939112487</td></tr><tr><td><code>INTERCEPT</code></td><td><code>INTERCEPT({2,3,9,1,8}, {6,5,11,7,5})</code></td><td>0.04838709677419217</td></tr><tr><td><code>KURT</code></td><td><code>KURT({3,4,5,2,3,4,5,6,4,7})</code></td><td>-0.15179963720841627</td></tr><tr><td><code>LARGE</code></td><td><code>LARGE({3,5,3,5,4,4,2,4,6,7}, 3)</code></td><td>5</td></tr><tr><td><code>LINEST</code></td><td><code>LINEST({1,9,5,7}, {0,4,2,3}, true, true)</code></td><td>2,1</td></tr><tr><td><code>LOGNORMDIST</code></td><td><code>LOGNORMDIST(4, 3.5, 1.2, true)</code></td><td>0.0390835557068005</td></tr><tr><td><code>LOGNORMINV</code></td><td><code>LOGNORMINV(0.0390835557068005, 3.5, 1.2, true)</code></td><td>4.000000000000001</td></tr><tr><td><code>MAX</code></td><td><code>MAX({0.1,0.2}, {0.4,0.8}, [true, false])</code></td><td>0.8</td></tr><tr><td><code>MAXA</code></td><td><code>MAXA({0.1,0.2}, {0.4,0.8}, {true, false})</code></td><td>1</td></tr><tr><td><code>MEDIAN</code></td><td><code>MEDIAN({1,2,3}, {4,5,6})</code></td><td>3.5</td></tr><tr><td><code>MIN</code></td><td><code>MIN({0.1,0.2}, {0.4,0.8}, {true, false})</code></td><td>0.1</td></tr><tr><td><code>MINA</code></td><td><code>MINA({0.1,0.2}, {0.4,0.8}, {true, false})</code></td><td>0</td></tr><tr><td><code>MODEMULT</code></td><td><code>MODEMULT({1,2,3,4,3,2,1,2,3})</code></td><td>2,3</td></tr><tr><td><code>MODESNGL</code></td><td><code>MODESNGL({1,2,3,4,3,2,1,2,3})</code></td><td>2</td></tr><tr><td><code>NORMDIST</code></td><td><code>NORMDIST(42, 40, 1.5, true)</code></td><td>0.9087887802741321</td></tr><tr><td><code>NORMINV</code></td><td><code>NORMINV(0.9087887802741321, 40, 1.5)</code></td><td>42</td></tr><tr><td><code>NORMSDIST</code></td><td><code>NORMSDIST(1, true)</code></td><td>0.8413447460685429</td></tr><tr><td><code>NORMSINV</code></td><td><code>NORMSINV(0.8413447460685429)</code></td><td>1.0000000000000002</td></tr><tr><td><code>PEARSON</code></td><td><code>PEARSON({9,7,5,3,1}, {10,6,1,5,3})</code></td><td>0.6993786061802354</td></tr><tr><td><code>PERCENTILEEXC</code></td><td><code>PERCENTILEEXC({1,2,3,4}, 0.3)</code></td><td>1.5</td></tr><tr><td><code>PERCENTILEINC</code></td><td><code>PERCENTILEINC({1,2,3,4}, 0.3)</code></td><td>1.9</td></tr><tr><td><code>PERCENTRANKEXC</code></td><td><code>PERCENTRANKEXC({1,2,3,4}, 2, 2)</code></td><td>0.4</td></tr><tr><td><code>PERCENTRANKINC</code></td><td><code>PERCENTRANKINC({1,2,3,4}, 2, 2)</code></td><td>0.33</td></tr><tr><td><code>PERMUT</code></td><td><code>PERMUT(100, 3)</code></td><td>970200</td></tr><tr><td><code>PERMUTATIONA</code></td><td><code>PERMUTATIONA(4, 3)</code></td><td>64</td></tr><tr><td><code>PHI</code></td><td><code>PHI(0.75)</code></td><td>0.30113743215480443</td></tr><tr><td><code>POISSONDIST</code></td><td><code>POISSONDIST(2, 5, true)</code></td><td>0.12465201948308113</td></tr><tr><td><code>PROB</code></td><td><code>PROB({1,2,3,4}, {0.1,0.2,0.2,0.1}, 2, 3)</code></td><td>0.4</td></tr><tr><td><code>QUARTILEEXC</code></td><td><code>QUARTILEEXC({1,2,3,4}, 1)</code></td><td>1.25</td></tr><tr><td><code>QUARTILEINC</code></td><td><code>QUARTILEINC({1,2,3,4}, 1)</code></td><td>1.75</td></tr><tr><td><code>RANKAVG</code></td><td><code>RANKAVG(4, {2,4,4,8,8,16}, false)</code></td><td>4.5</td></tr><tr><td><code>RANKEQ</code></td><td><code>RANKEQ(4, {2,4,4,8,8,16}, false)</code></td><td>4</td></tr><tr><td><code>RSQ</code></td><td><code>RSQ({9,7,5,3,1}, {10,6,1,5,3})</code></td><td>0.4891304347826088</td></tr><tr><td><code>SKEW</code></td><td><code>SKEW({3,4,5,2,3,4,5,6,4,7})</code></td><td>0.3595430714067974</td></tr><tr><td><code>SKEWP</code></td><td><code>SKEWP({3,4,5,2,3,4,5,6,4,7})</code></td><td>0.303193339354144</td></tr><tr><td><code>SLOPE</code></td><td><code>SLOPE({1,9,5,7}, {0,4,2,3})</code></td><td>2</td></tr><tr><td><code>SMALL</code></td><td><code>SMALL({3,5,3,5,4,4,2,4,6,7}, 3)</code></td><td>3</td></tr><tr><td><code>STANDARDIZE</code></td><td><code>STANDARDIZE(42, 40, 1.5)</code></td><td>1.3333333333333333</td></tr><tr><td><code>STDEVA</code></td><td><code>STDEVA({2,4}, {8,16}, {true, false})</code></td><td>6.013872850889572</td></tr><tr><td><code>STDEVP</code></td><td><code>STDEVP({2,4}, {8,16}, {true, false})</code></td><td>5.361902647381804</td></tr><tr><td><code>STDEVPA</code></td><td><code>STDEVPA({2,4}, {8,16}, {true, false})</code></td><td>5.489889697333535</td></tr><tr><td><code>STDEVS</code></td><td><code>STDEVS({2,4}, {8,16}, {true, false})</code></td><td>6.191391873668904</td></tr><tr><td><code>STEYX</code></td><td><code>STEYX({2,3,9,1,8,7,5}, {6,5,11,7,5,4,4})</code></td><td>3.305718950210041</td></tr><tr><td><code>TDIST</code></td><td><code>TDIST(60, 1, true)</code></td><td>0.9946953263673741</td></tr><tr><td><code>TINV</code></td><td><code>TINV(0.9946953263673741, 1)</code></td><td>59.99999999996535</td></tr><tr><td><code>TRIMMEAN</code></td><td><code>TRIMMEAN({4,5,6,7,2,3,4,5,1,2,3}, 0.2)</code></td><td>3.7777777777777777</td></tr><tr><td><code>VARA</code></td><td><code>VARA({2,4}, {8,16}, {true, false})</code></td><td>36.16666666666667</td></tr><tr><td><code>VARP</code></td><td><code>VARP({2,4}, {8,16}, {true, false})</code></td><td>28.75</td></tr><tr><td><code>VARPA</code></td><td><code>VARPA({2,4}, {8,16}, {true, false})</code></td><td>30.13888888888889</td></tr><tr><td><code>VARS</code></td><td><code>VARS({2,4}, {8,16}, {true, false})</code></td><td>38.333333333333336</td></tr><tr><td><code>WEIBULLDIST</code></td><td><code>WEIBULLDIST(105, 20, 100, true)</code></td><td>0.9295813900692769</td></tr><tr><td><code>ZTEST</code></td><td><code>ZTEST({3,6,7,8,6,5,4,2,1,9}, 4)</code></td><td>0.09057419685136381</td></tr></tbody></table>

### TEXT

<table><thead><tr><th width="187">Function</th><th width="351">Example call</th><th>Expected result</th></tr></thead><tbody><tr><td><code>CHAR</code></td><td><code>CHAR(65)</code></td><td>A</td></tr><tr><td><code>CLEAN</code></td><td><code>CLEAN("Monthly report")</code></td><td>Monthly report</td></tr><tr><td><code>CODE</code></td><td><code>CODE("A")</code></td><td>65</td></tr><tr><td><code>CONCATENATE</code></td><td><code>CONCATENATE("Andreas", " ", "Hauser")</code></td><td>Andreas Hauser</td></tr><tr><td><code>EXACT</code></td><td><code>EXACT("Word", "word")</code></td><td>false</td></tr><tr><td><code>FIND</code></td><td><code>FIND("M", "Miriam McGovern", 3)</code></td><td>8</td></tr><tr><td><code>LEFT</code></td><td><code>LEFT("Sale Price", 4)</code></td><td>Sale</td></tr><tr><td><code>LEN</code></td><td><code>LEN("Phoenix, AZ")</code></td><td>11</td></tr><tr><td><code>LOWER</code></td><td><code>LOWER("E. E. Cummings")</code></td><td>e. e. cummings</td></tr><tr><td><code>MID</code></td><td><code>MID("Fluid Flow", 7, 20)</code></td><td>Flow</td></tr><tr><td><code>NUMBERVALUE</code></td><td><code>NUMBERVALUE("2.500,27", ",", ".")</code></td><td>2500.27</td></tr><tr><td><code>PROPER</code></td><td><code>PROPER("this is a TITLE")</code></td><td>This Is A Title</td></tr><tr><td><code>REGEXEXTRACT</code></td><td><code>REGEXEXTRACT("Palo Alto", "Alto")</code></td><td>Alto</td></tr><tr><td><code>REGEXMATCH</code></td><td><code>REGEXMATCH("Palo Alto", "Alto")</code></td><td>true</td></tr><tr><td><code>REGEXREPLACE</code></td><td><code>REGEXREPLACE("Sutoiku", "utoiku", "TOIC")</code></td><td>STOIC</td></tr><tr><td><code>REPLACE</code></td><td><code>REPLACE("abcdefghijk", 6, 5, "*")</code></td><td>abcde*k</td></tr><tr><td><code>REPT</code></td><td><code>REPT("*-", 3)</code></td><td>*-*-*-</td></tr><tr><td><code>RIGHT</code></td><td><code>RIGHT("Sale Price", 5)</code></td><td>Price</td></tr><tr><td><code>ROMAN</code></td><td><code>ROMAN(499)</code></td><td>CDXCIX</td></tr><tr><td><code>SEARCH</code></td><td><code>SEARCH("margin", "Profit Margin")</code></td><td>8</td></tr><tr><td><code>SPLIT</code></td><td><code>SPLIT("A,B,C", ",")</code></td><td>A,B,C</td></tr><tr><td><code>SUBSTITUTE</code></td><td><code>SUBSTITUTE("Quarter 1, 2011", "1", "2", 3)</code></td><td>Quarter 1, 2012</td></tr><tr><td><code>T</code></td><td><code>T("Rainfall")</code></td><td>Rainfall</td></tr><tr><td><code>TRIM</code></td><td><code>TRIM(" First Quarter Earnings ")</code></td><td>First Quarter Earnings</td></tr><tr><td><code>UNICHAR</code></td><td><code>UNICHAR(66)</code></td><td>B</td></tr><tr><td><code>UNICODE</code></td><td><code>UNICODE("B")</code></td><td>66</td></tr><tr><td><code>UPPER</code></td><td><code>UPPER("total")</code></td><td>TOTAL</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.alldrafts.com/alldrafts-documentation/fields/formula-functions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
