Documentation/Calc Functions/CONCAT
TDF LibreOffice Document Liberation Project Community Blogs Weblate Nextcloud Redmine Ask LibreOffice Donate
Function name:
CONCAT
Category:
Text
Summary:
Concatenates multiple text strings into a single string.
The CONCAT function is an enhanced version of the CONCATENATE function, with CONCAT accepting cell ranges as arguments.
Syntax:
CONCAT(String 1 [; String 2 [; … [; String 255]]])
Returns:
Returns a text string formed by concatenating the string arguments end-to-end.
Arguments:
String 1 is a text string (in quotation marks), a number, a reference to a cell, a reference to a cell range, or an inline array of strings (within curly braces '{' and '}'). String 1 specifies the first string or strings that are to be concatenated.
String 2 through to String 255 are similar to String 1 but specify the subsequent strings that are to be concatenated.
- The limited utility formula
=CONCAT()
does not cause an error but returns an empty string. - The length of the string to be returned is limited to be less than 256 * (1024)2 characters. If the arguments passed would cause this limit to be exceeded, CONCAT reports a string overflow error (Err:513).
Additional details:
When a cell range is specified, the cells are traversed row by row (from top to bottom).
This function is not a requirement of ODF 1.2 but is compatible with the Microsoft Excel CONCAT function.
Examples:
Formula | Description | Returns |
---|---|---|
=CONCAT("Life is really simple, "; "but we insist on making it complicated "; "(Confucius).") | Here three individual strings are passed as separate arguments, with the function concatenating them and returning "Life is really simple, but we insist on making it complicated (Confucius).". | Life is really simple, but we insist on making it complicated (Confucius). |
=CONCAT(D1; D2; D3) where cells D1, D2, and D3 contain the strings "When nothing is going right,", " go left", and "!" respectively. | Here three individual strings are passed by cell references, with the function concatenating them and returning "When nothing is going right, go left!". | When nothing is going right, go left! |
=CONCAT({"The ", "journey ", "of ", "a ", "thousand ", "miles ", "begins ", "with ", "one ", "step."}) | Here ten individual strings are passed in an inline array, with the function concatenating them and returning "The journey of a thousand miles begins with one step.". | The journey of a thousand miles begins with one step. |
=CONCAT("Total: $"; 123.45) | Here a string and a number are passed as arguments, with the function concatenating them and returning "Total: $123.45". | Total: $123.45 |
=CONCAT(A1:B3) where cells A1, A2, A3, B1, B2, and B3 contain the strings "A1", "A2", "A3", "B1", "B2", and "B3" respectively. | Here the function concatenates the contents of all cells in the range A1:B3, returning "A1B1A2B2A3B3". Note the order of concatenation for a cell range. | A1B1A2B2A3B3 |
=CONCAT(A:B; 3:4) | Here the function concatenates the contents of all cells in columns A and B, together with the contents of all cells in rows 3 and 4. In this example, the contents of cells A3, A4, B3, and B4 could appear twice in the returned string. The exact string returned would be dependent on the contents of the cells in column A, column B, row 3, and row 4. | - |
Related LibreOffice functions:
ODF standard:
None.
Related (or similar) Excel functions:
CONCAT