Comments on: CONCATENATE in Excel: combine text strings, cells and columns

In your Excel workbooks, the data is not always structured according to your needs. Often you may want to split the content of one cell into individual cells or do the opposite - combine data from two or more columns into a single column. Continue reading

Comments page 8. Total comments: 449

  1. Thank you for this excellent guide. I have a series of concatenated sentences each with text intermixed with values (numbers) pulled from other cells. In some cases, I have used the TEXT function to render the desired number format. However, I am looking to make the values (whether or not with the TEXT function) to pop out of the surrounding text in a contrasting colour. How can I format it to do this? I was hoping the TEXT function would enable this, but cannot see how. Thank you.

    1. Hello,

      Please note that the TEXT function does not support color formatting. So if you copy a number format code from the Format Cells dialog that includes a color, e. g. $#,##0.00_);[Red]($#,##0.00), the TEXT function will accept the format code, but it won't display the color.

      Hope it will help you.

  2. Help

    Imstruggling to make 2 formulas based on these digits:

    9055170120100

    1) I need a formula which will turn it into this:

    05517 012.010

    -Which is remove the 9
    -Then space after the 5th digit
    -Add decimal after 7th digit

    and 2)

    I also need to turn a different cell into this:

    012.010

    -which is remove the first 6 digits
    - Then add the decimal in the same place as above.

    Any help woul be much appreciated!

  3. How can change names in single cell of a spread sheet from lastname, firstname
    entered just like that, with a comma. I want to cell to give me the names firstname lastname with no comma. Is that possible?

    1. You can do this by getting rid of your comma's. To do this, select all the names and then go to the "Data" tab and click on "Text to Columns". In this menu, you will make sure that "Delimited" is selected. Then click Next. On the next screen, make sure that only the "Comma" box is selected, then click Finish. When this happens, your single cell with LastName, FirstName will become two cells with LastName in the first cell and FirstName in the second cell. Then just use =CONCATENATE(FirstName Cell," ",LastName Cell) to get your desired results. If you want to be able to get rid of the first two columns, select your new results and copy them. Then under Paste Special, select paste values only.

  4. URGENT! - I have concatenate(C2, " ",B2),I have copied the data in the remaining fields.
    Now I need to REMOVE fields B & C without obtaining the #REF! error

  5. hi:

    i need any help please
    i have a single column with 2322 cells, and want to combine the data for each 20 cells together on next column and continue

    br
    Shahad

  6. Hello,

    I have set up my formula and it covers a large range. I separate the texts with commas. How do I remove the excess commas at the end, without shorting the range? Thanks in advance!

  7. I'm combining number cells. One of the number cells is formatted special to show three digits (000). But when I combine them the first zeros disappear. So, 001 in that cell needs to be displayed as 001 (which is exactly the number in that cell) not as 1 (single digit).

    How do I combine them and still keep my cell formatting the same.
    Thanks

    1. I'm struggling with the same issue. I have several cells that I need to combine with hyphens to use as a budget code, but some of them are formatted as text and some of them are formatted "special" with a certain number of digits like you described. Some of the columns with a leading "0" are formatted as text, but I can't for the life of me figure out how to change the others without losing the leading zero again. Any help would be appreciated!

      1. To keep the 0's in front of numbers, put a single quotation mark in front of them like this:

        '00....

  8. I have 2 columns Singer 1 and singer 2. I want to concatenate with comma separator. However in some rows only Singer 1 Values are available and if there is no value in singer 2 - I dun want the comma separator to be posted since there is a single value.

    For better understanding:
    Scenario 1 -
    Singer 1 - Jolly
    Singer 2 - Nerdsk
    Result of concatenation - Jolly, Nerdsk

    Scenario 2
    Singer 1 - Jolly
    Singer 2 -
    Result of Concatenation - Jolly,
    The result I m looking for is - Jolly without a comma

    Hope this explains what I am trying to convey.
    Do let me know a solution that I can implement.
    Thank You In Advance
    Rgds
    Ankur

    1. Use the below formula.
      =IF(ISBLANK(A2),A1, CONCATENATE(A1,",",A2))

      Regards,
      Taimoor

  9. Used CONCATENATE(A1:A3 & " ," ) to combine cells with a separator it is working fine(Used F9). Now i need to apply for all rows but it is not working. Can you help here. Thanks

    1. Hi Selva,

      Please try one of the following formulas:

      1. =CONCATENATE(A1,",",A2,",",A3,",")

      2. If you use Excel 2016, then you can try this array formula:
      =CONCAT(CONCATENATE(A1:A3,","))
      Please don’t forget to press Ctrl + Shift + Enter to complete it. Once you do this, Excel will automatically enclose the formula in {curly braces}. In no case should you type the curly braces manually, the formula won't work.

      Hope this will help you.

  10. Goal: Take information from cell A2 on sheet "Ref", then use that to concatenate that information to set a reference list for sheet "2".

    Cell 2!A40: =Ref!A2

    Cell 2!B40: =if(B40=0," ","=Ref!b"&A40)

    So, when sheet "Ref" has something in Ref!A2 then 2!B2 will show what is in cell Ref!B2)

    I want to then be able to copy sheet "2" to make sheets"3","4","5", etc. and have Sheet "3" show what is in cell Ref!B3 and so on for each following sheets.
    Thanks

    1. Hello,
      For me to understand the problem better, please send me a small sample workbook with your source data and the result you expect to get to support@ablebits.com. Please don't worry if you have confidential information there, we never disclose the data we get from our customers and delete it as soon as the problem is resolved.
      Please also don't forget to include the link to this comment into your email.
      I'll look into your task and try to help.

  11. How to make new row in one cell or make alt+enter in concatenate formula

  12. Hi there,

    I am trying to use the concatenate function on two cells, one that is formatted as a number and another cell that is formatted as a percentage.

    It seems the new combined cell doesn't maintain the % formatting, so I am just ending up with a number and a very long decimal.

    Is it possible to keep the % formatting in the combined cell?

    Thanks,
    Billy

    1. were you able to figure out this?

  13. Never mind, I solved it. Thanks.

    1. How did you solve it? I think I have the same question/problem, but haven't figured it out as of yet! Thanks

  14. in addtion to my question above, I format column C as General, not Text.

  15. I have a sheet formatted as a table, but when I try to use CONCATENATE it display the function text not the result of the function.

    For example:
    in cell A1 (header): CodeFirst
    in cell A2 (text value): AA
    in cell B1 (header): CodeSecond
    in cell B2 (text value): BB

    in cell C2: =CONCATENATE([@[CodeFirst]];[@[CodeSecond]])
    it display as it is, not AABB

    any ideas?

  16. Step 1 Sort names Alphabetically
    Step 2 Give 1 2 3 besides the names you wan't in order
    step 3 Sort selecting names & number by column having number ascending
    step 4 Use concatenate function for your numbered cell separating","
    =CONCATENATE(C2,",",C3,",",C4,",",C5,",",C6,",",C7,",",C8,",",C9,",",C10,",",C11)

  17. i Have 20 list of name like

    Kim
    Solonin
    Gafarova
    Ayubova
    Danilenko
    Dityatyev
    Agakov
    Karavaev
    Protopopov
    Bohn
    Williams
    Bhatia
    Miller
    Gass
    Townsend
    Hohberg
    Lai
    Nazarewycz
    Singh
    Ooi

    i want only 10 name in a single cell like kim,Solonin,Gafarova,Ayubov, etc
    using formula how ?

  18. Is it possible to concatenate data from columns based on a single reference column, so where the customer is the same name, concatenate all the references from each line into a single row:

    i.e.
    Input:
    A B
    27918 Select
    27922 Select
    27920 Select
    27921 Select
    27919 Wholesale
    27923 Wholesale
    27924 CSP Supplies
    27925 CSP Supplies

    Output:
    A B
    Select 27918,27922,27920,27921
    Wholesale27919,27923
    CSP 27924,27925

    Hope that makes sense?

  19. how do i concatenate below:

    1001
    1002
    1003
    1004
    1005
    1008
    1013
    1014
    1015
    1016
    1020
    1021
    1025
    1026
    1027
    1028
    1029
    1030

    to this format:

    1001 thru 1005, 1008, 1013 thru 1016, 1020, 1021, 1025 thru 1026

    thanks

    1. 1- Select the cell where you need the result.
      2- Go to formula bar and enter data range ex. =TRANSPOSE(A1:A5)&” “
      3- Based on your regional settings, you can also try =A1:A5 (instead of =TRANSPOSE(A1:A5)).
      4- Select the entire formula and press F9 (this converts the formula into values).
      5- Remove the curly brackets from both ends.
      6- Add =CONCATENATE( to the beginning of the text and end it with a round bracket).
      7- Press Enter

  20. what is the excel formula to reflect "8/1/2017" as "Aug"?

  21. Hi Aland,

    I have an excel table (C4:O12) that sums values W-L-T (win-loss-tie) records both horizontally and vertically when entering a "W", "L", or "T" in each cell in table with a resulting "0-0-0" format. I have the totals with this format in bottom row from C13:O13 as well as in column from P4:P12 Here are the following formulas Ive used:

    horizontal
    =CONCATENATE(COUNTIF(C4:O4,"W"),"-",COUNTIF(C4:O4,"L"),"-",COUNTIF(C4:O4,"T"))

    vertical
    =CONCATENATE(COUNTIF(C4:C12,"W"),"-",COUNTIF(C4:C12,"L"),"-",COUNTIF(C4:C12,"T"))

    How do I sum the totals for either column O, or row 13 to get an overall total in the same "0-0-0" format?

    THANKS !

    1. Hi, David,

      would it be possible for you to send us a sample workbook with your data and formulas you're using to support@ablebits.com? Don't forget to include the link to this comment.
      We'll look into the way your data is stored and try our best to help.

  22. Hello all,
    Is there a way concatenated results can be searchable (ctrl+find) and/or filterable?
    Thank you in advance for any tips :)

    1. Although this question was a bit more than a year ago, I too was attempting to figure this out and landed here. Excel can natively do a find of this information. With the native find window open select "Options<<" from there make sure you select Look in: "Values". The default is "Formulas" however this will not produce the results you are looking for. Hope this helps someone.

      1. thank you Aland for above info.

    2. Hello, Aland,

      sure they can :)

      As for searching, you can use our Advanced Find and Replace add-in. You can download its fully functional trial version here and see if it works as you need.

      As for the filter, you should be able to use Excel built-in one, but if for some reason it doesn't work, you can try one from our collection of Quick Tools.

      Hope they help!

  23. How would you combine values from multiple cells separated by commas only when values exist?

    Example

    A B C
    1|George Herman Ruth
    2|Jackie Robinson
    3|Mark Marche McGwire

    Row 1= Concatenate(A1,",",B1,",",C1) = George, Herman, Ruth
    Row 2 = Jackie,,Robinson
    I don't want a comma when no values exist to separate.

    1. Hi, was this question ever resolved, I have the same issue
      1 Major;Double Major
      2 Major
      3 Major;Double Major

      1. The double comma is there because the middle cell is blank. Try this:

        =IF(B2="",CONCATENATE(A2,", ",C2),CONCATENATE(A2,", ",B2,", ",C2))

  24. Hi All, This is my actual formula =IF(F$1,'Apr-2016'!J16,"") "Apr-2016" is the name of the sheet in the workbook, i would like to use concatenate so I can choose the year (2016) from another cell. please help many thanks

  25. how to use concatenate for (bluedart 5565565 24-Jul-17) in one column.. data in brackets are in 3 different column.

  26. SREI $ 41,26,000 54 days
    how to use concatenate for figure including comma = Devid-$41,26,000-54days

  27. sry, i missing something
    actually the SOURCE DATA IS
    oldno54,newno4355,eaststreet,virudhunagar,mutharpatti,sattur,greengarden,chennai,tn,tamilnadu,600018

    and the excel format is,

    ADDRESS1 ADDRESS2 ADDRESS3
    oldno54,newno4355 eaststreet,virudhunagar mutharppati,sattur

    ADDRESS4 CITY STATE PINCODE
    greengarden,chennai tn tamilnadu 600018

    so please help me,solve this problem immediately.

  28. hi, i am sonai.i have one question please answer it.
    the format of the EXCELL is,
    ADDRESS1 ADDRESS2 ADDRESS3 ADDRESS4 CITY STATE PINCODE
    so, split the address to this format,
    the source data is
    oldno54,newno4355,eaststreet,virudhunagar,mutharpatti,greengarden,chennai,tn,tamilnadu,600018
    please, solve the problem.it's my humble request youto.immediately

  29. This is great, I understand the concatenate and the and operators better now. Thanks a lot. WOW!

  30. I have inserted a row and typed in the formula

    =CONCATENATE(J1," ",K1)

    and have combined the first and last names of my clients. How do I now place the combined data into another cell without showing the above formula in the Excel formula bar?

    Keith

    1. I copied my combined names and then did a Paste Special into a new column. I tried a few choices until the right one popped up.

  31. pls I need Ur assistance to concatenate course still outstanding (CDO) of students prepared in Excel sheet e.g =if( A2:D2=0, concatenate A1,B1,C1,D1,",") can't it work if not I need Ur assistance.

  32. Hello,

    How to a concatenate this:

    A1 = "has a account balance of" and B1 = $ 2,250.38

    When I used concatenate the result always "has a account balance of 2250.38,
    the Result that I want is " has a account balance of $ 2,250.38"

    Thank you in Advance

    1. The problem is caused by the fact that your number is not entered into the cell with a $ symbol, etc. but the cell itself is formatted as currency (the actual cell content is just 2250.38 which is why the $ does not show when concatenating). The following will work:

      =CONCATENATE(A1,DOLLAR(B1,2))

  33. how to remove duplicate entries ( which is comma separated) found in single columns ?
    example :- 8,4,7,8,6,3,3,9,6
    expected output :- 3,4,6,7,8,9

    1. I found your answer but in excel sheet if you require just mail

      my presentation is T D S but helpful.

  34. Hi there
    How can the last cell in a column filled from the first cell will automatically minus
    for example IN column A when in a2 was a number a2 - a1 and if in A3 was number A3 - A1 only the last fill cell minus first cell and write Answer in A10

  35. Greetings of the Day Svetlana!

    I just feel lucky that I found this forum.

    Thanks a ton for the solution.
    It works like a charm...

    Best Regards,
    Abhinav

  36. Hi Svetlana,

    The () didn't work so I've uploaded a screenshot and here the link.

    https://ibb.co/jqf3Ha

    I hope it helps!

    Thanks in advance.

    Regards,
    Abhinav

    1. Hi Abhinav,

      All comments containing external links are subject to manual validation, that's why they did not get posted immediately (the only one working anti-spam technique we could think of :)

      As for the formula, the "iframe..." string is the same for all rows except for the ID from column 1, right? If so, you can split it into 2 parts, and put the parts into 2 separate cells. For example:

      Cell F1: <iframe width="560"… embed/
      Cell F2: " frameborder="0"… </iframe>

      And then, you can use the RIGHT() function to extract the ID (from A2 in this example), and concatenate the 3 parts like this:
      =F1&RIGHT(A2,LEN(A2)-FIND("/",A2, FIND("/", A2, FIND("/",A2)+1) +2))&F2

  37. Hi Svetlana,
    Thanks for replying.

    I did enter the desired result but it appears that it was not posted?

    I'll try again, don't know why it was removed.I'll put the contents of the Column 2 in the () if it helps in posting.

    Column 1: https://youtu.be/ZWiPQINKvW8

    Column 2: ()

    So, Column 2 is the desired result and ZWiPQINKvW8 is the ID from Column 1.

    Hope it gets posted this time.

    Thanks!
    Abhinav

  38. Hi

    Thank you for the detailed examples.

    I've a bit complicated query though, may be because I'm new to this.

    So, I need to fill Youtube URLs in one column and the Embed codes in another.

    Is it possible that I can just fill in the URL and the embed code generates by any formula?
    For E.g.

    Column 1: https://youtu.be/ZWiPQINKvW8

    Column 2:

    Column 2 has the Embed code which has the Video ID after "embed/" that appears at the end after the "/" in Column 1.

    It is same for all the videos and I've to maintain a sheet of Thousands of them!
    So far I've been copying and pasting both from the YouTube videos but would love to know if it's possible to merge the partial text(ID) from column 1 in the middle of the text in Column 2.

    Thanks in advance!

    Regards,
    Abhinav

    1. Hi Abhinav,

      For me to understand the task better, can you please give an example of the partial text(ID) in column 2 and the merged string (desired result)?

  39. I have 4 columns of data (A - D) and each project has 13 rows.
    Column data: Name, start, finish, duration
    Project 1
    13 rows of data

    Project 2
    13 rows of data

    How do I get Concatenate or another method to read the 13 rows of data across and then down??:
    A3, B3, C3, D3,
    A4, B4, C4, D4,
    A5, B5, C5, D5

    I need all 13 rows to read to a single row left to right.
    Can you help??

    1. We feel you bruh... You can search the World Wide Web for the solution, but don't go for a page :")

  40. How do i concatenate if I only want single quotes('') on the first set of numbers but nothing on the last 2. example. This is how I want the results to look.

    Results:
    insert into #driver select'98765432',20170517,5

    Thanks for your help!

    1. Hello, Mark,
      the ASCII code for single quotes ('') is CHAR(39). Assuming that the numbers are in A1:C1, to get the desirable result, try the following formula:

      =CONCATENATE(CHAR(39), A1 & CHAR(39),",",B1,",",C1)

      Just add the references to the cells with the text to this formula and you're good to go :)

      1. Awww so cute of you for the help :")

        1. What? Are you two years old Kal? What a jerk.

        2. jesus christ, she only answered your question, no need to be condescending...

  41. When i concatenate =1&2&3&4&5 it gives 12345
    In my program i want to remove any one of the items, say 4
    and it should show 1235.
    Can any one guide me how to do it?
    Thank you

    1. concatenate =1&2&3&4&5 it gives 12345
      then integer =int (12345) above value-11110
      your answer will be there.

    2. Just minus 11110

  42. Hello,

    If there a way to Concatenate and use Right at the same time?

    Ex: 123456 to ***456

    Doing so with on one column, ID number is 123456 then ID number 2 would be ***456

    Thank You

    1. Hello, Jess,

      if your ID is in A1, then enter the following in B1 to get ***456:
      =CONCATENATE("***",RIGHT(A1,3))

  43. hi am trying use double code text file to be upload.

    pls refer.below sample format.
    "IH","INV-3456","2007-11-20","1","1","TESTING","2","1","AED","1000","CIF","","","",""
    "ID","1234","03056980","NormalHSCode","N","kg","1","kg","1000","m","","1000","US","123456789012345","1","12352","","","11"

    please help

  44. Can u Please help me??

    How can we find Price(numbers) from letters?
    eg.A B C D
    a 1 ab 12
    b 2
    c 3 bc 23
    .....................
    In column D i want the values of merged letters...
    please help me

  45. Can u Please help me??

    How can we find Price(numbers) from letters?
    eg.A B C D
    a 1 ab 12
    b 2
    c 3 bc 23

    In column D i want the values of merged letters

  46. Sub Code()
    ' Range("C17").Select
    ' Selection.Copy
    ' Sheets("Sheet2").Select
    ' Range("B10").Select
    ' ActiveSheet.Paste

    For x = 2 To 24
    con = ""
    Sheets("BB").Select
    state1 = Cells(x, 9).Value
    district1 = Cells(x, 10).Value
    village1 = Cells(x, 12).Value
    Sheets("AA").Select
    For y = 2 To 60
    state2 = Cells(y, 10).Value
    district2 = Cells(y, 11).Value
    village2 = Cells(y, 13).Value
    If state2 = state1 And district2 = district1 And village2 = village1 Then
    con = Cells(y, 15).Value = Cells(y, 15).Value + ("y14", " , ","x15")
    'Sheets("BB").Select
    Cells(x, 16).Value = Cells(x, 16).Value + ", "

    End If
    Next
    Next
    End Sub

    y there is an error in concentation
    thank u

  47. how to add a space between word and number (Ex:ACT222) In a single cell.
    Thank You.

    1. If the text and numbers are always in blocks of 3 and 3 (e.g. ACT222, BOB876 etc.) then (assuming data is in cell A1):

      =CONCATENATE((MID(A1,1,3))," ",MID(A1,4,3))

  48. Hi Svetlana,

    Great website. Is there vba formula that could help sort my text strings like this:

    House1
    House2
    House3
    Truck1
    Truck2
    Truck3

    Result

    House1|House2|House3
    Truck1|Truck2|Truck3

    Thank you.

    1. Hello, Preston,

      we don't build VBA formulas, but we can provide another option which you may find useful.
      If your data starts in A1, enter the next formula in B1:
      =INDIRECT(ADDRESS(ROW()*3-2,1))&" | "&INDIRECT(ADDRESS(ROW()*3-1,1))&" | "&INDIRECT(ADDRESS(ROW()*3,1))
      This will return House1|House2|House3
      and copy the formula to the row(s) below (read how do to it here) to apply for other group(s) of the data.
      Hope it helps!

  49. Hi,
    After concatenation I want any part (any one of the cells to be concatenated) of the result as BOLD ITALIC. How to do it with VB and without VB?
    Thanks.

  50. How to connect text string for varing range given below
    Input:
    ST1 Cataract
    ST2 Macular degeneration
    AMD
    ARMD
    ST3 Diabetic retinopathy
    nonproliferative retinopathy
    diabetic eye disease
    leaking blood vessels
    ST4 vitreous hemorrhage
    extravasation of blood
    leakage of blood
    ST5 Macular hole
    macular break

    Output:
    ST1 Cataract
    ST2 Macular degeneration OR AMD OR ARMD
    ST3 Diabetic retinopathy OR nonproliferative retinopathy OR diabetic eye disease OR leaking blood vessels
    .....
    Since range is not fixed for each output how to use CONCATENATE or any other function

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)