+ Reply to Thread
Results 1 to 6 of 6

lookup one column and merge similar cell into one (concat and line break)

  1. #1
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2021
    Posts
    211

    lookup one column and merge similar cell into one (concat and line break)

    Hi guys,

    I have this this table where i am trying to cell in column b into 1 cell if there are similar cells in column A.

    I tried this formula but something went wrong in C2.
    CONCATENATEIF($A$2:$A$16,A2,$B$2:$B$16," ")

    Edited: Also for clarity, basically I am trying to combine multiple items in one report so I can get red of duplicate reports in column A.

    merge pic.png
    Attached Files Attached Files
    Last edited by mq1973; 01-24-2020 at 09:43 AM.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: lookup one column and merge similar cell into one

    Do you mean

    =CONCAT(IF($A$2:$A$324=A2,$C$2:$C$324&" ",""))


    Array-entered

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    However, I'm not sure if the CONCAT function is available in Excel 2016
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2021
    Posts
    211

    Re: lookup one column and merge similar cell into one

    Thanks Ace. I am getting 0's in column C! and Yes, I am using Excel 2016.

    Edit: I changed it to CONCAT(IF($A$2:$A$16=A2,$B$2:$B$16&" ","")) and it is working perfect. Is there away to make each items starts from a new line (it's like using alt+Enter function)? So instead of having 3 items appear on one line, I would like each item to start with a new line within the same cell.


    merge cells 2.png
    Last edited by mq1973; 01-24-2020 at 09:25 AM.

  4. #4
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2021
    Posts
    211

    Re: lookup one column and merge similar cell into one

    I guess the proper question is how to use CONCAT with line break. Please help!

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: lookup one column and merge similar cell into one (concat and line break)

    Please try at C2

    =TEXTJOIN(CHAR(10),,REPT($B$2:$B$16,$A$2:$A$16=A2))

  6. #6
    Forum Contributor
    Join Date
    04-26-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2021
    Posts
    211

    Re: lookup one column and merge similar cell into one (concat and line break)

    Quote Originally Posted by Bo_Ry View Post
    Please try at C2

    =TEXTJOIN(CHAR(10),,REPT($B$2:$B$16,$A$2:$A$16=A2))
    Thanks so much Bo_Ry. This is exactly what I was looking for

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 03-07-2018, 05:34 AM
  2. [SOLVED] Merge similar cells in column and adjacent columns
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2016, 06:58 AM
  3. [SOLVED] Merge similar data in a nother column
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-24-2014, 06:11 PM
  4. [SOLVED] Merge cells in corresponding column based on similar values
    By Niclal in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 12-22-2014, 10:54 AM
  5. Formula to lookup similar value in adjacent cell
    By thorpechris in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-14-2013, 07:02 AM
  6. Replies: 3
    Last Post: 03-09-2013, 10:23 AM
  7. Lookup Values, 2 Worksheets, one similar column
    By ladron in forum Excel General
    Replies: 5
    Last Post: 09-20-2012, 04:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1