+ Reply to Thread
Results 1 to 8 of 8

Concatenate columns into 1 cell

  1. #1
    Registered User
    Join Date
    12-23-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    19

    Question Concatenate columns into 1 cell

    I have a product list and it has 2 columns; pa_size and pa_volume. The next 2 columns are ma_size and ma_volume. In these columns, there will be a value on each sub product of the main product. The cell is blank where the main product located.
    I need to concatenate the pa_size column into the blank cell in the row above at the ma_size cells that have the values in them and then go past the empty cells and find the next value and start over and concatenate the next set of cells.
    I have attached an example of what I am trying to do. I filled in the top 3 examples and left the 2 bottom ones blank. I need to go through this workbook and have this formula be able to fill down since there is over 5000 products in the spreadsheet.
    Can anyone help a fella out here?
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Concatenate columns into 1 cell

    I used a combination of VBA ( a UDF - User Defined Function) and an ARRAY Formula.

    First I copied Tiger Avatar's CONCATALL(range, delimiter) code into a module
    Please Login or Register  to view this content.
    I copied your table to columns F,G,H, I to test this.

    In G2 copied down is this arrayed function

    =IF(AND(ISBLANK(F2),ISNUMBER(F3)),CONCATALL(F3:INDEX(F3:F$5000,MATCH(1,1/ISBLANK(F3:F$5000),0)),"\"),"")

    ...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. Press F2 on that cell and try again.

    That can be copied and pasted over to I2 also and copied down
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,673

    Re: Concatenate columns into 1 cell

    I don't know how to do this with formulas. Here is a VBA solution.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    11-18-2015
    Location
    Madrid
    MS-Off Ver
    2016
    Posts
    95

    Re: Concatenate columns into 1 cell

    Hi! This worked for me. Hope it helps!
    Attached Files Attached Files
    excelbat.com: free Excel tools, macros...

  5. #5
    Registered User
    Join Date
    12-23-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Concatenate columns into 1 cell

    Thanks guys. Do you have any ideal how many nights I have been working and watching videos and reading about how to solve this issue? TOO many.
    Thanks for your help.

  6. #6
    Registered User
    Join Date
    12-23-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Concatenate columns into 1 cell

    I plugged in this formula and code and it didn't work. I did some investigating and I have some cells with numbers and letters and this appears to be why it will not work. What does the formula look like when this is the case?

  7. #7
    Registered User
    Join Date
    12-23-2013
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Concatenate columns into 1 cell

    Got it. Use ISREF instead of ISNUMBER.

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Concatenate columns into 1 cell

    I think you need to use something like F3<>"". IsRef will always return true when you have a reference to a cell inside the parentheses.

+ 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: 11
    Last Post: 07-28-2015, 05:08 PM
  2. Concatenate with Double Info in Concatenate Cell
    By MRoz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-10-2015, 02:07 PM
  3. Replies: 2
    Last Post: 01-05-2015, 08:06 PM
  4. Replies: 1
    Last Post: 01-13-2014, 04:21 AM
  5. Concatenate multiple rows and columns into 1 cell
    By mj44 in forum Excel General
    Replies: 19
    Last Post: 08-29-2013, 02:37 PM
  6. Replies: 0
    Last Post: 08-20-2012, 12:10 PM
  7. Concatenate columns with cell data containing Carriage Returns
    By Rob in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-04-2005, 04:05 AM

Tags for this Thread

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