{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":2186,"path":"application-development/form-builder-glide-family-release/formulas-columns-table-builder.md","title":"Formulas for column values in Table Builder","bundle":null,"doc_type":null,"release":"australia","body":"\n# Formulas for column values in Table Builder\n\nYou can use a predefined function and create a formula to calculate the value of a column without writing a script. Use a predefined function or create a nested formula by using the existing predefined functions to calculate the column value type.\n\n## Supported operators\n\nThe following comparison operators are supported only for number type values.\n\n-   = \\(Equal to\\)\n-   &lt;&gt; \\(Not equal to\\)\n-   &gt; \\(Greater than\\)\n-   &lt; \\(Less than\\)\n-   &gt;= \\(Greater than or equal to\\)\n-   &lt;= \\(Less than or equal to\\)\n\n**Parent Topic:**[Field configuration in Table Builder](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/application-development/form-builder-glide-family-release/field-parameters.md)\n\n## Simple math functions\n\nUse simple math functions to perform basic mathematical calculations on numeric value columns.\n\n### AVERAGE\n\nReturns the average value of the arguments.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|AVERAGE\\(argument 1, argument 2, … argument n\\)|Numeric value, function call, or variable|Numeric value|\n\nExamples:\n\n-   Function: AVERAGE\\(1,2,3\\)\n\n    The result is 2.\n\n-   Formula: AVERAGE\\(LENGTH\\(first\\_name\\), LENGTH\\(last\\_name\\)\\)\n\n    The result is the average value of the number of characters in the first\\_name column and last\\_name column.\n\n\n### DIVIDE\n\nReturns the final quotient value after consecutively dividing the first argument with the next argument until the function reaches the last argument.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|DIVIDE\\(argument 1, argument 2 … argument n\\)|Numeric value, function call, or variable|Numeric value|\n\nExamples:\n\n-   Function: DIVIDE\\(10,20, 0.25, 10\\)\n\n    The result is 0.2.\n\n-   Formula: DIVIDE\\(LENGTH\\(full\\_name\\),2\\)\n\n    The result is the number of characters in the full\\_name column divided by 2.\n\n\n### INDEXMATCH\n\nRetrieves the first not null value from the specified set of arguments.\n\n<table id=\"table_lb3_qfn_dwb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nINDEXMATCH\\(argument 1, argument 2 , … argument n\\)\n\n</td><td>\n\nString, numeric value, function call, or variable.\n\n</td><td>\n\nNumeric value\n\n</td></tr></tbody>\n</table>Example:\n\nFunction: INDEXMATCH\\(\"\",\" \",2,\"string\"\\)\n\nThe result is 2.\n\n### MAX\n\nReturns the highest value in the specified arguments.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|MAX\\(argument 1, argument 2, … argument n\\)|Numeric value, function call, or variable|Numeric value|\n\nExamples:\n\n-   Function: MAX\\(1, -5, 20, 6\\)\n\n    The result is 20.\n\n-   Formula: MAX\\(LENGTH\\(first\\_name\\), LENGTH\\(last\\_name\\)\\)\n\n    The result is the number of characters in the first\\_name column or last\\_name column whichever is the highest.\n\n\n### MIN\n\nReturns the lowest value in the specified arguments.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|MIN\\(argument 1, argument 2, … argument n\\)|Numeric value, function call, or variable|Numeric value|\n\nExamples:\n\n-   Function: MIN\\(1, -5, 20, 6\\)\n\n    The result is -5.\n\n-   Formula: MIN\\(LENGTH\\(first\\_name\\), LENGTH\\(last\\_name\\)\\)\n\n    The result is the number of characters in the first\\_name column or last\\_name column whichever is the lowest.\n\n\n### MULTIPLY\n\nReturns the total multiplied value of the arguments.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|MULTIPLY \\(argument 1, argument 2, … argument n\\)|Numeric value, function call, or variable|Numeric value|\n\nExamples:\n\n-   Function: MULTIPLY\\(12, 4\\)\n\n    The result is 48.\n\n-   Formula: MULTIPLY\\(order, 2\\)\n\n    The result is the order column value multiplied by 2.\n\n\n### POWER\n\nReturns the result of the base value raised to the power of the exponent value.\n\n<table id=\"table_e35_mkn_ytb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nPOWER\\(argument 1, argument 2\\)\n\n</td><td>\n\nargument 1 is base and argument 2 is exponent.-   base: number or variable\n-   exponent: number or variable\n\n</td><td>\n\nNumber\n\n</td></tr></tbody>\n</table>Examples:\n\n-   Function: POWER\\(3,2\\)\n\n    The result is 9.\n\n-   Formula: POWER\\(LENGTH\\(full\\_name\\),2\\)\n\n    The result is the number of characters in the full\\_name column to the power of 2.\n\n\n### SUBTRACT\n\nReturns the result value after consecutively subtracting the next available argument from the earlier argument until the function reaches last argument.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|SUBTRACT\\(argument 1, argument 2 … argument n\\)|Numeric value, function call, or variable|Numeric value|\n\nExamples:\n\n-   Function: SUBTRACT\\(1.15, 0.02, 0.45, -0.85\\)\n\n    The result is 1.53.\n\n-   Formula: SUBTRACT\\(LENGTH\\(full\\_name\\), LENGTH\\(first\\_name\\)\\)\n\n    The result is the number of characters from the full\\_name column minus the number of characters from the first\\_name column.\n\n\n### SUM\n\nReturns the sum of all the arguments.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|SUM\\(argument 1,argument 2, ... argument n\\)|Numeric value, function call, or variable|Numeric value|\n\nExamples:\n\n-   Function: SUM\\(0.03, -0.02, 1\\)\n\n    The result is 1.01.\n\n-   Formula: SUM\\(LENGTH\\(first\\_name\\), LENGTH\\(last\\_name\\)\\)\n\n    The result is the total number of characters in the first\\_name column plus the total number of characters in the last\\_name column.\n\n\n### COUNTIF\n\nReturns the number of arguments that match the specified criteria within the specified set of arguments.\n\n<table id=\"table_p1x_yd4_dwb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nCOUNTIF\\(argument 1, argument 2, argument n-1, criteria\\)\n\n</td><td>\n\n-   argument 1 … argument n: String, numeric value, function call, or variable.\n-   criteria: Criteria that evaluates the specified set of arguments. String, numeric value, function call, or variable.\n\n</td><td>\n\nNumeric value\n\n</td></tr></tbody>\n</table>Example:\n\nFunction: COUNTIF\\(2,3,2,\"string\",2\\)\n\nThe result is 2.\n\n### MODE\n\nReturns the most frequently repeating value in the specified set of arguments.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|MODE\\(argument 1,argument 2, ... argument n\\)|Numeric value, function call, or variable|Numeric value|\n\nExample:\n\nFunction: MODE\\(1, 2, 2, 3, 3, 3\\)\n\nThe result is 3.\n\n## String functions\n\nUse string functions to reformat or perform calculations on string column values.\n\n### CONCATENATE\n\nJoins one or more input strings into a single string.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|CONCATENATE\\(string 1, string 2, … string n\\)|String, function call, or variable|String|\n\nExamples:\n\n-   Function: CONCATENATE\\(first\\_name, \".\", last\\_name, \"@\", LOWERCASE\\(example\\), \".com\"\\)\n\n    The result is the concatenated value &lt;first\\_name\\_value&gt;.&lt;last\\_name\\_value&gt;@example.com. In this example, &lt;first\\_name\\_value&gt; and &lt;last\\_name\\_value&gt; are placeholders.\n\n-   Function: CONCATENATE\\(first\\_name, \" \", last\\_name\\)\n\n    The result is the concatenated string of first\\_name column value and last\\_name column value separated by a white space.\n\n\n### ISBLANK\n\nFinds white spaces or blank values in the string and returns true if there are any.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|ISBLANK\\(argument\\)|String or value|True or false|\n\nExamples:\n\n-   Function: ISBLANK\\(“example\\_string”\\)\n\n    The result is false.\n\n-   Function: ISBLANK\\(full\\_name\\)\n\n    The result is true only when there are empty spaces in the full\\_name column. Otherwise, the result is false.\n\n\n### LENGTH\n\nReturns the total number of characters in the input string.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|LENGTH\\(argument\\)|String value, function call, or variable|Numeric value|\n\nExamples:\n\n-   Function: LENGTH\\(\"example\\_string\"\\)\n\n    The result is 14.\n\n-   Function: LENGTH\\(full\\_name\\)\n\n    The result is the total number of characters in the full\\_name column value.\n\n\n### LOWERCASE\n\nConverts the input string to all lowercase characters.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|LOWERCASE\\(argument\\)|String, function call, or variable|String in lowercase|\n\nExamples:\n\n-   Function: LOWERCASE\\(“ExamPle inpuT stRing”\\)\n\n    The result is example input string.\n\n-   Function: LOWERCASE\\(sys\\_created\\_by\\)\n\n    The result is the lower case string of the sys\\_created\\_by column value.\n\n\n### REPLACE\n\nReplaces the characters in the source string with the characters in the target string.\n\n<table id=\"table_efv_2hd_g5b\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nREPLACE\\(source\\_string, target\\_string, replacement\\_string\\)\n\n</td><td>\n\n-   source\\_string: String, function call, or variable\n-   target\\_string: String, function call, or variable\n-   replacement\\_string: String, function call, or variable\n\n</td><td>\n\nString\n\n</td></tr></tbody>\n</table>Examples:\n\n-   Function: REPLACE\\(“Pepperoni Pizza”, “Pepperoni”, “Cheese”\\)\n\n    The result string is Cheese Pizza.\n\n-   Function: REPLACE\\(\"abe.tuter@example.com\", \"example\", company\\_name\\)\n\n    The result string is abe.tuter@&lt;company\\_name&gt;.com. In this example, &lt;company\\_name&gt;is a place holder.\n\n\n### TITLECASE\n\nConverts the input string to all title case characters.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|TITLECASE\\(argument\\)|String, function call, or variable|String in title case|\n\nExamples:\n\n-   Function: TITLECASE\\(\"example string\"\\)\n\n    The result is Example String.\n\n-   Function: TITLECASE\\(full\\_name\\)\n\n    The result is the full name column value in the title case.\n\n\n### UPPERCASE\n\nConverts the input string to all uppercase characters.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|UPPERCASE\\(argument\\)|String value, function call, or variable|String in uppercase|\n\nExamples:\n\n-   Function: UPPERCASE\\(\"eXamPle sTring\"\\)\n\n    The result is EXAMPLE STRING.\n\n-   Function: UPPERCASE\\(state\\)\n\n    The result is the State column value in upper case.\n\n\n### FIND\n\nSearches for the first occurrence of a substring within a string and returns the position of the first occurrence.\n\n**Note:** This function is case sensitive.\n\n<table id=\"table_vvp_1hn_dwb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nFIND\\(search\\_string, source\\_string, from\\_index\\)\n\n</td><td>\n\n-   search\\_string: Substring, function call, or variable.\n-   source\\_string: Main string, function call, or variable.\n-   from\\_index: Index position in the main string from where the search should start. Numeric value, function call, or variable.\n\n</td><td>\n\nNumeric value \\(integer\\). When the substring does not exist in the main string, -1 is returned.\n\n</td></tr></tbody>\n</table>Example:\n\nFunction: FIND\\(\"morning\", \"Good morning\"\\)\n\nThe result is 5.\n\n### SEARCH\n\nSearches for a substring within a string and returns the position of the first occurrence of the substring.\n\n**Note:** This function is case insensitive.\n\n<table id=\"table_udg_zc4_dwb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nSEARCH\\(search\\_string, source\\_string, from\\_index\\)\n\n</td><td>\n\n-   search\\_string: Substring, function call, or variable.\n-   source\\_string: Main string, function call, or variable.\n-   from\\_index: Index position in the main string from where the search should start. Numeric value, function call, or variable.\n\n</td><td>\n\nNumeric value \\(integer\\). When the substring does not exist in the main string, -1 is returned.\n\n</td></tr></tbody>\n</table>Examples:\n\n-   SEARCH\\(\"Morning\", \"Good morning\"\\)\n\n    The result is 5.\n\n-   SEARCH\\(\"World\",\"Hello world!\"\\)\n\n    The result is -1.\n\n\n### SUBSTRING\n\nRetrieves a substring from a string at the specified index position and for the specified length.\n\n<table id=\"table_jjp_wb4_dwb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nSUBSTRING\\(source\\_string, start\\_index, length\\)\n\n</td><td>\n\n-   source\\_string: String, function call, or variable.\n-   start\\_index: Position in the string from where the substring is extracted. Numeric value, function call, or variable.\n-   length: Length of the substring that should be extracted.\n\n</td><td>\n\nString\n\n</td></tr></tbody>\n</table>Example:\n\nSUBSTRING\\(\"Hello, Good Morning\", 7, 4\\)\n\nThe result substring is 'Good'.\n\n## Date and time functions\n\nUse date and time functions to calculate or reformat the date and time column values.\n\n### NOW\n\nReturns the current date and time of the instance in ISO format \\(YYYY-MM-DD hh:mm:ss\\).\n\n|Syntax|Input|Output|\n|------|-----|------|\n|NOW\\(\\)|No arguments are required for this function|ISO format of current date and time|\n\nExample:\n\nFunction: NOW\\(\\)\n\nThe result is the current date and time in ISO format.\n\n### TODAY\n\nReturns the current date with time offset to start of the day in ISO format in UTC time zone.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|TODAY\\(\\)|No arguments are required for this function|Current date with time offset to start of the day in ISO format.|\n\nExample:\n\nFunction: TODAY\\(\\)\n\nThe result is the current date and start time of the day in ISO format.\n\n### TIMEDIFF\n\nEvaluates the time duration difference between two dates.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|TIMEDIFF\\(argument1, argument2\\)|Date in ISO format \\(YYYY-MM-DD hh:mm:ss\\) as string or variable|Duration|\n\nExamples:\n\n-   Function: TIMEDIFF\\(\"2021-05-02 9:10:12\", \"2021-04-07 6:2:23\"\\)\n\n    The result is 25 03:07:49.\n\n-   Formula: TIMEDIFF\\(sys\\_created\\_on, NOW\\(\\)\\)\n\n    The result is the time duration difference between the sys\\_created\\_on date and the current date of the system.\n\n\n### DATEDIF\n\nEvaluates the difference between the two dates in days, months, or years.\n\n<table id=\"table_s4h_33n_dwb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nDATEDIF\\(start\\_date, end\\_date, date\\_difference\\_unit\\)\n\n</td><td>\n\n-   start\\_date: Date in ISO format \\(YYYY-MM-DD or YYYY-MM-DD hh:mm:ss\\) as string or variable.\n-   end\\_date: Date in ISO format \\(YYYY-MM-DD or YYYY-MM-DD hh:mm:ss\\) as string or variable.\n-   date\\_difference\\_unit: Character String and either \"Y\",\"M\", or \"D\" in lowercase or uppercase. Default is \"D\".\n\n</td><td>\n\nNumeric duration value based on the specified date difference unit.\n\n</td></tr></tbody>\n</table>Example:\n\nFunction: DATEDIF\\(\"2021-05-02 9:10:12\", \"2021-05-05 6:2:23 \",\"d\"\\)\n\nThe result is 3.\n\n### DATE\n\nCreates a date from the specified individual year, month, and day values. The created date is in Coordinated Universal Time \\(UTC\\) time zone.\n\n<table id=\"table_ek1_jdn_dwb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nDATE\\(year,month,day\\)\n\n</td><td>\n\n-   year: Numeric value, variable or function.\n-   month: Numeric value, variable or function.\n-   day: Numeric value, variable or function.\n\n</td><td>\n\nDate in ISO format \\(YYYY-MM-DD hh:mm:ss\\)\n\n</td></tr></tbody>\n</table>Example:\n\nFunction: DATE\\(2021,5,2\\)\n\nThe result is 2021-05-02 00:00:00.\n\n### DAY\n\nRetrieves the numerical day component from the specified date.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|DAY\\(date\\)|Date in ISO format \\(YYYY-MM-DD or YYYY-MM-DD hh:mm:ss\\) as string, variable, or function.|Numeric value \\(integer\\). The values range from 1 through 31.|\n\nExamples:\n\n-   Function: DAY\\(\"2021-05-029:10:12\"\\)\n\n    The result is 2.\n\n-   Function: DAY\\(NOW\\(\\)\\)\n\n    The result will be the day component of the current date and time.\n\n\n### MONTH\n\nRetrieves the numerical month component from the specified date.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|MONTH\\(date\\)|date: Date in ISO format \\(YYYY-MM-DD or YYYY-MM- DD hh:mm:ss\\) as string or variable.|Numeric value \\(integer\\). The values range from 1\\(January\\) through 12\\(December\\).|\n\nExamples:\n\n-   Function: MONTH\\(\"2021-05-02 9:10:12\"\\)\n\n    The result is 5.\n\n-   Function: DAY\\(NOW\\(\\)\\)\n\n    The result will be the month component of the current date and time.\n\n\n### YEAR\n\nRetrieves the year component from the specified date.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|YEAR\\(date\\)|Date in ISO format \\(YYYY-MM-DD or YYYY-MM-DD hh:mm:ss\\) as string, variable, or function.|Numeric value \\(integer\\)|\n\nExamples:\n\n-   Function: YEAR\\(\"2021-05-02 9:10:12\"\\)\n\n    The result is 2021.\n\n-   Function: YEAR\\(NOW\\(\\)\\)\n\n    The result will be the year component of the current date and time.\n\n\n### WEEKDAY\n\nReturns the numerical day of the week for the specified date. The day range is 1 \\(Sunday\\) through 7 \\(Saturday\\).\n\n|Syntax|Input|Output|\n|------|-----|------|\n|WEEKDAY\\(date\\)|date: Date in ISO format \\(YYYY-MM-DD or YYYY-MM- DD hh:mm:ss\\) as string or variable.|Numeric value \\(integer\\)|\n\nExample:\n\nFunction: WEEKDAY\\(\"2021-05-02 9:10:12\"\\)\n\nThe result is 1.\n\n### TEXT\n\nRetrieves the specific date components in a date in string format.\n\n<table id=\"table_znr_d1n_dwb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nTEXT\\(date, format\\_text\\)\n\n</td><td>\n\n-   date: Date in ISO format \\(YYYY-MM-DD or YYYY-MM-DD hh:mm:ss\\) as string, variable.\n-   format\\_text: Date components as string or variable that are to be extracted.\n\n</td><td>\n\nString\n\n</td></tr></tbody>\n</table>Example:\n\nTEXT\\(\"2022-08-17 9:10:12\",\"yyyy-MM\"\\)\n\nThe result is 2022-08.\n\n### DATEVALUE\n\nConverts a date in text format into a date in ISO format.\n\n<table id=\"table_opb_d44_dwb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nDATEVALUE\\(date\\_text\\)\n\n</td><td>\n\ndate\\_text: Date stored as text must be in YYYY-MM-DD format.\n\n</td><td>\n\nDate in ISO format \\(YYYY-MM-DD hh:mm:ss\\) as string.\n\n</td></tr></tbody>\n</table>Example:\n\nFunction: DATEVALUE\\(\"2021-05-02\"\\)\n\nThe result is 2021-05-02 00:00:00.\n\n### WORKDAY\n\nReturns the nearest working day for the specified input date by excluding the specified holidays and weekends before or after the specified n number of days.\n\n<table id=\"table_zyw_b2n_dwb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nWORKDAY\\(start\\_date, days, holiday 1,holiday 2, ..., holiday n\\)\n\n</td><td>\n\n-   start\\_date: Date in ISO format \\(YYYY-MM-DD or YYYY-MM-DD hh:mm:ss\\) as string or variable.\n-   days: Number of days as a numeric value, string, or function.\n-   holiday 1...holiday n \\(Optional\\): Date in ISO format \\(YYYY-MM-DD or YYYY-MM-DD hh:mm:ss\\) as string or variable.\n\n</td><td>\n\nDate in ISO format \\(YYYY-MM-DD hh:mm:ss\\) as string.\n\n</td></tr></tbody>\n</table>Example:\n\nFunction: WORKDAY\\(\"2022-08-17 9:10:12\",2\\)\n\nThe result is 2022-08-19 00:00:00.\n\n### NETWORKDAYS\n\nCalculates the number of working days between two dates by excluding weekends and specified holiday dates. Number of working days includes the start date and end date.\n\n<table id=\"table_opy_qf4_dwb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nNETWORKDAYS\\(start\\_date,end\\_date,holiday 1,holiday 2, ... holiday n\\)\n\n</td><td>\n\n-   start\\_date: Date in ISO format \\(YYYY-MM-DD or YYYY-MM-DD hh:mm:ss\\) as string or variable.\n-   end\\_date: Date in ISO format \\(YYYY-MM-DD or YYYY-MM-DD hh:mm:ss\\) as string or variable.\n-   holiday 1,holiday 2, ... holiday n \\(optional\\) : List of holidays that should be excluded while calculating working days.\n\n</td><td>\n\nNumeric value \\(integer\\)\n\n</td></tr></tbody>\n</table>Example:\n\nFunction: NETWORKDAYS\\(\"2022-08-17 20:10:12\",\"2022-08-19 9: 10:12\"\\)\n\nThe result is 3.\n\n## Logical functions\n\nUse logical functions to perform logical operations on column values.\n\n### AND\n\nPerforms a logical AND operation on the arguments.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|AND\\(argument 1, argument 2\\)|String, function call, or variable|True or false|\n\nExamples:\n\n-   Function: AND\\(2&gt;3, 4&lt;5\\)\n\n    The result is false.\n\n-   Formula: AND\\(LENGTH\\(sys\\_created\\_by\\)&gt;25, LENGTH\\(sys\\_updated\\_by\\)&gt;25\\)\n\n    The result is true only when the number of characters in both the sys\\_created\\_by and sys\\_updated\\_by columns are greater than 25. Otherwise, the result is false.\n\n\n### IF\n\nExecutes the specified statements based on the Boolean output of the conditional expression.\n\n<table id=\"table_pt3_zgn_ytb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nIF\\(&lt;conditional\\_expression&gt;, &lt;do\\_this\\_when\\_true&gt;, &lt;do this\\_when\\_false&gt;\\)\n\n</td><td>\n\n-   conditional\\_expression: Logical conditional expression, function call, or variable\n\n**Note:** Logical comparison of strings is not supported in the conditional expression.\n\n-   do\\_this\\_when\\_true: String, numeric value, function call, or variable that is returned when the condition evaluates to true\n-   do\\_this\\_when\\_false: String, numeric value, function call, or variable that is returned when the condition evaluates to false\n\n</td><td>\n\nString, numeric value, function call, or variable based on the Boolean output of the conditional expression.\n\n</td></tr></tbody>\n</table>Examples:\n\n-   Function: IF\\(number\\_of\\_incidents &gt;= 5, \"High\", \"Medium\"\\)\n\n    If the number of incidents is greater than 5, the string ‘High’ is returned. In other cases, the string ‘Medium’ is returned.\n\n-   Function: IF\\(LENGTH\\(full\\_name\\) &gt; 100, \"Number of characters exceed the limit\", \"Number of characters within the limit\"\\)\n\n    If the number of characters for the full\\_name column is above 100, the string 'Number of characters exceed the limit' is returned. Otherwise, the string 'Number of characters within the limit' is returned.\n\n\n### OR\n\nPerforms logical OR operation on the arguments.\n\n|Syntax|Input|Output|\n|------|-----|------|\n|OR\\(argument 1, argument 2\\)|Conditional expression, function call, or variable|True or false|\n\nExamples:\n\n-   Function: OR\\(2&gt;3,4&lt;5\\)\n\n    The result is true.\n\n-   Formula: OR\\(LENGTH\\(first\\_name\\)&gt;25, LENGTH\\(last\\_name\\)&lt;25\\)\n\n    The result is true when the number of characters in the first\\_name column is greater than 25 or the number characters in the last\\_name column is less than 25. Otherwise, the result is false.\n\n\n### IFERROR\n\nEvaluates expression 1 and returns the expression 1 value when there are no errors in the expression 1. When an error occurs while evaluating expression 1, expression 2 is evaluated and expression 2 value is returned.\n\n<table id=\"table_wgl_rln_dwb\"><thead><tr><th>\n\nSyntax\n\n</th><th>\n\nInput\n\n</th><th>\n\nOutput\n\n</th></tr></thead><tbody><tr><td>\n\nIFERROR\\(expression 1, expression 2\\)\n\n</td><td>\n\n-   expression 1: Arithmetic, Logical expression, function call, String, numeric value or variable.\n-   expression 2: Arithmetic, Logical expression, function call, String, numeric value or variable.\n\n</td><td>\n\nResult of expression 1 when there are no errors in expression 1. Otherwise, result of expression 2.\n\n</td></tr></tbody>\n</table>Example:\n\nFunction: IFERROR\\( MULTIPLY\\(snr\\_factor, signal\\), MULTIPLY\\( default\\_factor, signal\\)\\)\n\nIf the snr\\_factor value is a valid number, the multiplied value of snr\\_factor with signal is returned. If the snr\\_factor value is not a valid number, the multiplied value of default\\_factor value with signal is returned.\n\n"}}