|
String functionsString functions are functions that have a non-numerical result. A string is a sequence of characters not interpreted as a number, e.g. Jones, "25". CELL Cell text/formula functionCELL(column,row) returns the contents of the cell with coordinates column and row as text. CELL(A,5) returns the text 5*6 when cell A5 contains 5*6. CHAR Character functionCHAR(x) returns the character with ANSI code x. The result is a string value of length 1 (if x>0). CHAR(65.0) returns the string value 'A' See table: ANSI character set. CODE Character to ANSI code conversionCODE(str) returns the ANSI code number of the first character of the string str. If the length of the string is 0, i.e. the string is empty, then the function returns 0. CODE("Andy") returns 65.00 See table: ANSI character set. CONCAT Concatenate stringsCONCAT(str1,str2,...) joins two or more strings (text items) into one single string. CONCAT("Total ","value") returns "Total value". LEFT Left portion of stringLEFT(str,n) returns the first n characters of str. If n equals 0, then the LEFT function returns an empty string. If n is equal to or more than the length of the string str, the function returns the complete string. LEFT("Position",3) returns "Pos" LEN Length of stringLEN(str) returns the length of the string str. LOWER Lowercase functionLOWER(str) converts the string str to lowercase. LOWER('TOTAL') returns "total" MID Middle portion of a stringReturns a specific number of characters from a text string, starting from a specified position. MID(str,pos,n) returns middle n characters from str starting at position pos. The first character has position number 1, and so on. MID("statistics,3,4) returns "atis" REPT Repeat functionREPT(str,n) creates a string consisting of str repeated n time. REPT("*",5) returns "*****" RIGHT Right portion of a stringRIGHT(str,n) returns the last n characters of str. If n equals 0, then the RIGHT function returns an empty string. If n is equal to or more than the length of the string str, the function returns the complete string. STR Number to string conversionSTR(x,n) returns the numeric value x as a string, with n decimal places. STR(25.56,1) returns the string value "25.6" UPPER Uppercase functionUPPER(str) converts the string str to uppercase. UPPER('total') returns "TOTAL" VALUE String to number conversionVALUE(str) evaluates str as a number. VALUE("text") returns an error See also |