42
votes
Accepted
How do I concatenate a string literal of my cell to a string of another cell?
It looks like you want the & operator
I'm not quite clear which thing you are concatenating to which in the question; however, you can do either
=$BJ$2 & "24"
or
=$BJ$2 & BH1
or
="...
36
votes
Accepted
Concatenating only filled cells
Try TEXTJOIN:
=textjoin(" vs ",1,C10:C14)
The second parameter is set to 1 indicating that empty cells should be ignored. Zero will include those empty cells.
27
votes
Accepted
How Do I Combine Columns In Google Spreadsheets?
The following formula can be used to merge one column after another:
={A1:A5; M1:M5}
16
votes
Concatenate several columns into one in Google Sheets
A shorter version of the formula in this other answer
=FILTER({A:A;B:B;C:C}, LEN({A:A;B:B;C:C}))
Community wiki
14
votes
CONCATENATE a string with an ArrayFormula
In Google Sheets, the simplest solution is to just use CONCAT instead of CONCATENATE.
=ARRAYFORMULA(CONCAT(H1:H,I1:I))
CONCAT will return only two values and can be used in this manner for an array ...
9
votes
How Do I Combine Columns In Google Spreadsheets?
If the columns are A, E, G (for example), then the following command combines them:
={filter(A:A, len(A:A)); filter(E:E, len(E:E)); filter(G:G, len(G:G))}
Here, I first filter the columns by len() ...
6
votes
Concatenate several columns into one in Google Sheets
A little longer, but can be constrained to a limited array (not whole columns):
=transpose(split(textjoin("|",1,{A1:C4}),"|"))
where the order does not matter. Where it does:
=transpose(split(...
6
votes
Concatenating only filled cells
Both of the solutions above work if there is at least one cell containing text. However:
= JOIN(" vs ",SPLIT(JOIN("%",C10:C14),"%",0))
Would return %%%% if C10:C14 were all empty and.
= JOIN( " vs ...
6
votes
Accepted
Date Format Lost When Combining Two Cells Using "&" and CONCATENATE in Google Sheets
You can do the formatting on the fly:
=text(B2,"m/d/yyyy")&C2
Google Sheets Help: TEXT()
4
votes
Accepted
Appending text to each column in Google Sheets
Please try:
Find: (.+)
Replace with: $1-banner.jpg
Search: This sheet
Search using regular expressions
Replace all.
4
votes
How do I prepend a string to a column of cells in Google Spreadsheets?
You can do this using the search and replace feature in Google Sheets with regular expression and specified range.
In the search and replace dialog use these values
Find: ^/(.+)
Replace: http://$1
...
4
votes
Concatenating only filled cells
I've found another solution:
=JOIN(" vs ",SPLIT(JOIN("%",C10:C14),"%",0))
The % can be any symbol really that isn't present in the list, like a comma, or ampersand, or question mark.
4
votes
Concatenate ordered values in one single string
Use the JOIN() function:
=join(" - ",sort(Sheet1!B:B, 1, TRUE))
SORT() returns an array of values.
JOIN() concatenates an array with a joining string, in this case " - " without the quotes.
4
votes
Accepted
Problem with CONCATENATE when used inside of arrayformula
Please try:
=ArrayFormula(if(E2:E>0,B2:B&" | "&C2:C&" | "&D2:D,""))
I would have expected:
=arrayformula(if(E2:E>0,CONCATENATE(B2:B," | ",C2:C," | ",D2:D),""))
to produce the ...
3
votes
Split content of one row into multiple rows?
Use the Google Sheets array handling features and FILTER to get the desired result
=FILTER({A:A,B:B,E:E;A:A,C:C,E:E;A:A,D:D,E:E},LEN({A:A;A:A;A:A}))
Note: If you spreadsheet use comma , as the ...
3
votes
Accepted
Constrain a Array<string> formula result to a list in a single cell
You can use JOIN to stitch the pieces together with a given delimiter:
=join(",", f o r m u l a )
3
votes
How can I insert formatted links in Google Sheet concatenations?
As the OP already realized, getValue() and getValues() return a string object for cells containing an hyperlink and the value returned when the object is concatenated is the link text that the OP ...
3
votes
Accepted
Join two cells data - COCATENATE not working properly
Date is a number. It's the number of days from Jan 1899. It's just formatted to look like yyyy-mm-dd. To get displayed value instead of actual value, use TO_TEXT
=CONCATENATE(C2,"Dia", TO_TEXT(E2))
...
3
votes
Concatenate using an array formula to result in last name.firstname
perhaps try it like this:
=ARRAYFORMULA(IF(LEN(A:A), B:B&"."&A:A, ))
3
votes
Accepted
How can I use ARRAYFORMULA (or something similar) with GOOGLETRANSLATE?
ARRAYFORMULA does not support GOOGLETRANSLATE. The best you can have is to pre-program the array like this:
={GOOGLETRANSLATE(B20, "en", "de");
GOOGLETRANSLATE(B21, "en", "de");
GOOGLETRANSLATE(...
2
votes
Split, reorder, concat inline
Use these GSheet functions to reverse the order of the words in a string.
Write in cell A1 ="TRICK NO THIS IS"
and in cell B1 =JOIN(" ";TRANSPOSE(SORT(TRANSPOSE(SPLIT(A1;" "));1;FALSE)))
It creates ...
2
votes
Accepted
Duplicate then concatenate in Google Spreadsheets
Try this formula.
Formula
=REGEXREPLACE(REPT(A1 & ":",2),".$","")
Explained
First the following string is being repeated twice: RESULT_OF_A1 combined with a semicolon.
The last semicolon in ...
2
votes
Accepted
CONCATENATE inside IMPORTRANGE inside Query
Yes, it's possible.
But first, bear in mind that =CONCATENATE("a","b") is the same as ="a"&"b", but shorter.
Example:
=QUERY(
IMPORTRANGE("key","A:Z"),
"SELECT Col1, Col2, Col3 WHERE Col1 ...
2
votes
Accepted
Calling a date with CONCATENATE is resolving to strange number
All is considered a string when you concatenate elements. Therefore you need to format the text as a date. The following formula does that.
Formula
="Happy " & TEXT(B2, "dd/MM/yyyy")
Reference
...
2
votes
Accepted
Split Text and reorganize and concatenate back together
Assuming You provided a exact format of data,
=REGEXREPLACE(F2,"(\d+) (\d+)", "$2/A$1/9")
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
concatenate × 88google-sheets × 86
formulas × 60
google-sheets-arrayformula × 43
google-sheets-query × 27
regex × 8
google-apps-script × 3
importrange × 3
regexextract × 3
google-apps × 2
conditional-formatting × 2
google-sheets-arrays × 2
formatting × 1
date × 1
google-sheets-cell-format × 1
google-translate × 1
google-sheets-filter × 1
importhtml × 1
importdata × 1
mail-merge × 1