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 6. Total comments: 449

  1. I have a cell (B2). cell value is: SAHANSRA,NAVJOT This is Lastname,Firstname
    I am using: LEFT(B2,FIND(",",B2)-1) and MID(B2,FIND(",",B2)+1,10) respectively to pull the name apart and place them into separate cells.
    What I need to do is place the LASTNAME into a static array with spaces to fill for 30 characters total. The results of the Lastname formula is now in cell N25
    REPLACE(N25,(LEN(N25)+1),(30-(LEN(N25)))," ")
    I need the result of the last formula to look like "SAHANSRAbbbbbbbbbbbbbbbbbbbbbb"
    where "b" is a space (22 of them) I thought this would give me my 22 spaces, but it only gives me 1.
    HELP!! thank you in advance.

  2. hi, how i can use concatenate with condition?
    for example i have 2 columns A & B and the condition is if we have same number in column B with different name in column A, and i need to add them in same cell (C).
    do we have i formula?
    A B C
    elie 1 elie,Rita
    Rita 1 elie,Rita
    Joseph 2 Joseph,Noha
    Noha 2 Joseph,Noha

  3. I have a question with what I am finding is a difficult if/then situation.
    Say I have a column with 3 separate values over hundreds of rows: AA BB or CC
    AA is unique but BB and CC ultimately will be the same.
    I need to concatenate 3 cells based off of the above breakdown.
    The first part will be DEF: (with the colon) which is common for all of the outputs.
    The next part will be either GHI:: or JKL:: depending on AA, BB or CC with JKL:: being associated with BB & CC designations.
    Then the last part is a unique number that will be on its own ######.
    The end result will need to be DEF:GHI::###### (AA value) or DEF:JKL::###### (BB or CC value) all depending on the values AA BB CC.

    Keep hitting a wall with figuring out the IF AA then GHI:: portion.

    Thanks,

    Mike

  4. How do I format after using concatentate using a formula for the two values?
    For example: =concatenate((d3/d4)," / " (d5/d4)) gives values like:
    1.425212521521 / 1.4526265654
    But, I only want these values to be 3 numbers after the decimal. Is this possible if the returned value is a text string?

  5. Hello I want to use concatenate function
    0000 1 /15-16

    I want 00001/15-16

    I am not getting

    1. Set Number Format to General.
      =CONCATENATE(A1,B1,C1)

      Regards,
      Taimoor

      1. Also Set Number format for your; 0000 to Text.

        Regards,
        Taimoor

  6. Hi there, I've been trying to combine these into one cell without losing the zeros infront of columns C & D but have failed. Can you please help?
    A1 B1 c1 d1
    P HHL 0007040 0114876823
    Thank you!

  7. 1 A Banana Closed
    2 B Apple Closed
    3 B Banana
    4 A Apple Closed
    5 A Apple Closed

    Dear Friend, Kindly help me out in above i want a formula in which excel itself concatenate values of column 1 in which all other values are same, like i want answer in one cell like (4,5) , because its other column values A Apple Closed are same.

  8. how to concatenate different characters within a cell???

  9. How can I combine values from different cells in one column?
    Eg.
    A B C D
    20 50 80 A = 20, B = 50, C = 80

  10. How do one sum up a value like this 75+17+46+05+28 already in a single cell.

    you find a lot of value like this in a single excel cell, how do one add it up 83+24+32+79+74

    53+21+59+82+65

    02+54+33+84+16

    86+22+59+34+04

    57+03+27+39+54

    1. Just add a + sign at the beginning

  11. Hi,

    I want to limit the content of a cell to the following format:

    XX YY 00-ZZZZ-EDWW

    How can i do it using Data Validation or any other way?

    thanks,

  12. I've used the Concat function and joined three cells successfully. Now, how can I cut and paste the "merged" cells into a word document?

    1. Hi Barbara,

      In Excel, select the cell with your CONCAT formula, and press Ctrl+C to copy it. Switch to your Word document, place the mouse pointer to where you want the merged text to appear and press Ctrl+V to paste it.

  13. Hi,
    I had a Excel sheet which has many columns . Let say A1,D1 and G1 are has to be concatenated.

    A1 has value 134574935
    D1 has date in 03/05/2018
    G1 has date in 05/05/2018

    I want result as
    insert into tablename values('134564935','03-May-2018','05-May-2018');

    Note:- date format has changed and the delimeter in the format has also changed.

    Please help me to solve this . Thanks in advance .

  14. I'm trying to concatenate two columns of data. One contains area codes for phone numbers, and the second column contains the numbers themselves. The problem is that when the phone number begins with a zero, this isn't included in the final concatenated value, resulting in nonviable phone numbers. How can I go about fixing this?
    Thanks

    1. Hanelise:
      If you want to keep the leading zeros, you just need to format the cells as Text before entering the data. This should be OK for you because when you concatenate the cells they will go to text anyway.

  15. Thank You - Wonderful article - its exactly what i wanted.

  16. Hi,

    I need to concatenate a few cells but A2 it's a number 08 and I need the zero in front, but for some reason it's only showing the number 8 alone, same with all the single digits like 4 it should be 04. For the 2018 I need only the 18 but it's giving me the complete year.

    8_4_2018_

    =CONCATENATE(A3,"_",B3,"_",C3,"_",S3,"",Z3,"_",K3,"_")

    Correct way should be:

    08_04_18 It's the date but in this format.

    Thanks

  17. Is there a quick way to build a formula:
    =concatenate(a1,a2,a3,a4 .... a1024)
    or
    =concatenate(a1,b1,c1,d1, ... amj1)
    without typing the addresses one by one ?

    Please note, that the cells a1..a1024, or a1..amj1, contain results of other formulas, so their content varies, and the TRANSPOSE trick seems not to work :-(

    BTW, most of the above internal results will be just empty strings, and the rest will be just one or two letters, so the actual result of the above concatenate will be only 100-200 characters.

    Bests,
    Mike

  18. What is my text has a "READY TO LET" text, and I like to join text and formulas like :

    ="INFLATION TO [READY TO LET YEAR] @ 4% ("&I64&" years)", I get this:

    INFLATION TO [READY TO LET YEAR] @ 4% (4 years), but I need this:

    INFLATION TO "READY TO LET YEAR" @ 4% (4 years)

    Would you please let me know how to write this formula?

    Please advise,

  19. Hi there,
    How to concatenate two columns that mimic this (N'Doe, John', N'Doctor') where Doe, John is the first column and Doctor is the second column. This (N'Doe, John', N'Doctor') has to be used in SQL and XML. Thanks

  20. Thanks. This is what I really wanted

  21. Hi

  22. Hello Sir/Madam,
    plz solve my problem that how to write many dates in a cell in excel sheet since a have a range of dates for example here Mr. Ram has taken 6 spells leave in a month as

    SN NAME DAYS FROM DATE TO DATE

    1. Mr.Ram 5 07/05/2018 11/05/2018
    2 18/05/2018 19/05/2018
    3 21/05/2018 23/05/2018
    2 25/05/2018 26/05/2018
    2 28/05/2018 29/05/2018
    1 31/05/2018 blank

    2. Mr.Paul 1 02/05/2018
    3 05/05/2018 07/05/2018
    2 11/05/2018 12/05/2018
    1 15/05/2018

    3. Mr.Mac 3 18/05/2018 20/05/2018
    3 26/05/2018 28/05/2018

    4. Mr.Bond 7 23/05/2018 29/05/2018

    sir/madam,
    i want to write all DAYS in a cell like above and all FROM DATE in a cell like above and also TO DATE in a cell like above.

    sir i want that if there is only two spells of leave of an employee there shows only two lines in cell and if there is three spells of leave of an employee then there shows only three lines in cell AND if there is only on day of leave then shows in only from date cell and to date will blank as shown in 6th spell as 1 day 31/05/2018.

    please HELP ME SIR/MADAM

  23. NL01AB1895

    i just want above result as per below give.

    1895_NL_01_AB

    Also, i want a particulars word search in a column in excel.

    So, Please guide us.

    1. Hi Drishti,

      I'd simply use Excel's Replace All feature:

      1. Press the Ctrl + H to open the Replace tab of the Find and Replace dialog.
      2. Type /node in the "Find what" box.
      3. Type /in-en/node in the "Replace with" box.
      4. Hit "Replace All".

      Done.

  24. How to do?
    32
    12
    32
    32
    32
    92
    36
    192
    96
    36
    24
    32
    32
    32
    100
    32
    32
    384
    32
    32
    to this

    32,12,32,32,32,92,36,192,96,36,24,32,32,32,100,32,32,384,32,32
    (in one shot without using one by one concatenation) .

    1. Manisha:
      I use the Concatenate Transpose method on the infrequent occasions I have done this. I decided to look for other methods to answer your question and came across this excellent article on five different methods to accomplish your task. Take a look at the article and I know you will find a method that best suits your situation.
      https://excelchamps.com/blog/concatenate-a-range-of-cells/

  25. I am trying to reference other cells in excel that have formulas for an API. The following formula works: =RTD($B$1,,"srpt//OPT/20180629/p/137/USD", "Bid")

    But when I replace certain parts with referencing, it does not work:
    =RTD($B$1,,"B4//opt/$H$2/p/G4/usd","bid")

    How do I fix this?

    Kind Regards,
    Liviu

  26. It's very usefull. Thanks !

  27. All the things very nice....I were looking for concatenate function with carriage return and my luck & pleasure that I visited this page :)

    Got a very nice and easy solution.

    Thank you.

  28. hi svetlana will you assist me to make letter lower case to uppercase formula for example I want" formula" text " rmul only to uppercase mean ruml lowercase to upper case RUML thank you

    1. Paban:
      Where the original text is in A1
      Enter =UPPER(A1) in an empty cell.
      The function has an expanded explaination in the article above.

  29. I have a large data that are over 13K rows, I want to combine all of them into one cell. I know you can only have 8192 characters in an Microsoft Excel cell. I want to know if anyone know how to create a VBA macro or better way to have a formula that can do the job. Right now each cell has 9 characters in each cell so I am combining about 3200 cell at once, but I have to do this over and over again until i finish all my 13K records. I need to separate them by comma (,).
    For example: 123456789,123456789,123456789,123456789
    That is how I want it but I know I could only do 3200 records at a time.
    My original records looks like this:
    123456789
    123456789
    123456789

  30. I may not know the right word to use pls pardon me:
    My name is Apple
    Joy
    Peace
    goodness
    love
    sound
    mind

    I want Column 1(My name is) to be linked with each of the Column 2 (name list) above in a new column(Column 3) Thanks

  31. I want to use a concatenation formula. Pulling information for several cells the cells either have a date for example cell F4 or are left blank. I want the formula to pick up the date or put in “no date at this time” and I’m not sure how to make the formula work.

  32. I want to use a concatenation formula. Pulling information for several cells the cells either have a date for cell F or are left blank. I want the formula to pick up the date or put in “no date at this time” and I’m not sure how to make the formula work.

    1. Elizabeth:
      Will this work?
      Test to see if cell is empty, if it is then return "No Date At This Time", otherwise return the cell's contents.
      Where the data is in cell A18, it looks like this:
      =IF(ISBLANK(A18),"No Date at this time",A18)

  33. Mr.Doug
    Thank you for reply
    but i want result is 010155
    this result is 1155

    1. That sounds like a cell formatting issue.
      Select the cells and choose format cells and then choose custom and use one of the provided formats or use one as a starting point and then change it to the format you want.

  34. I want to concat A1 cell value 01
    B1 cell value 05
    c1 cell value 5
    how to concat
    I want result d1 cell 01055
    Please reply me

    1. D1=Concatenate(A1,b1,c1)

  35. COL1 COL2

    1 AAA
    1 GGG
    1 FFF
    2 GGG
    2 HHH
    3 RRR
    3 JJJ

    concatenate text based on criteria in Excel? FORMULAS

    1. Not sure what the criteria is, but here's a way to do this.
      If numbers are in cells A1 through A10 and letters are in cells B1 through B10 and your criteria is if a cell contains a "1" then:
      =IF(OR(A1=1,A2=1,A3=1,(Concatenate(B1," ",B2," ",B3))

  36. thanks for the support

  37. Thank you!

    While I'm pretty sue, that there is an easier way to do what I need (replace input value with text including said value), probably even in single column (yet no tutorial, how to do that, with concatenate function I achieved my goal:
    =CONCATENATE("OAM-";C2;"/PP-2017")
    And even expanded it for future use (albeit at the cost of 2 extra columns *sad*):
    =CONCATENATE("OAM-";C2;"/";D2;"-201";E2)
    Result (where XXXXX is the input number):
    OAM-XXXXX/PP-2017

  38. Hello!
    How do I concatenate based a number such as...

    N = 5
    String = "Hello"
    Desired output = "xxxxxHello"

    N = 3
    String = "Hello"
    Desired output = "xxxHello"

    Thanks

  39. here is one i am trying to do...
    I have a pricing matrix and i have named each cell in the matrix by its location within the matrix, example...
    A1=ABa1, B1=ABa2, C1=ABa3
    A2=ABb1, B2=ABb2, C2=ABb3
    A3=ABc1, B3=ABc2, C3=ABc3

    so on another sheet i have my products that are coded with these name. example...
    Product A: S1234a1
    Product B: S4567b4

    i want to strip that "a1" off the end and then use it in the formula to show the price for ABa1.
    I use "RIGHT" formula to grab the 'a1' text, and then i use CONCATENATE with plain AB text to create the value ABa1 displayed in the cell. so thats great i can see a string on data that is exactly what i want

    so heres my dilemma...
    in any cell, if i manually type in "=ABa1", it refers to the cell which i named ABa1 and the value within that cell is displayed. makes sense works perfect...

    but what i want to do is use my CONCATENTATED string of data, rather that actually keying in the my "=ABa1".

    somehow like this....=(the concatenated data string i want use), and then will have the same affect as when i manually key it in.

  40. 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.

  41. 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!

  42. 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.

  43. 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

  44. 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

  45. 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!

  46. 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....

  47. 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

  48. 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.

  49. 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.

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 :)