+ Reply to Thread
Results 1 to 9 of 9

Combine multiple columns of data into one column

  1. #1
    Registered User
    Join Date
    07-02-2014
    Location
    USA
    MS-Off Ver
    2013 Pro
    Posts
    6

    Combine multiple columns of data into one column

    Hi,
    I'm looking for a way to combine (not concatenate) the data from 5 columns in a single column. In other words, if I had 5 rows of data in column A, 3 rows of data in column B, 11 rows of data in column C, 8 rows of data in column D and 9 rows of data in column E, I want column F to have the 36 values (5+3+11+8+9 = 36) from the other columns.

    The data has significantly more rows than I've used in my example and cutting and pasting is getting a little tedious every time I need to combine the data.

    The data starts in row 3 for each column and any given row has no more than 258 values.
    There are no intermingling blank cells in a given column; the blanks are at the end of each column.
    The data is text, not numeric

    (Back story: The data in columns A-E is generated using array formulas that pulls data from other worksheets. I need to combine those columns in to one, then remove duplicate values and sort the resulting combined column. The removing duplicates and sorting part I can handle; it's the combining part I'm having problems with. I was about to drop into VBA to solve this but since when it comes to writing formulas I'm a noob, I thought that I check here first. I saw this thread but no one solved it.)

    Any help would greatly appreciated!
    Thanks!
    Paul
    Last edited by PMBottas; 08-10-2014 at 11:56 PM. Reason: typo

  2. #2
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Combine multiple columns of data into one column

    Hi,

    Welcome to the Forum.

    Please check the attached file and see if it suits your requirement.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-02-2014
    Location
    USA
    MS-Off Ver
    2013 Pro
    Posts
    6

    Re: Combine multiple columns of data into one column

    No, that's not what I meant. I'm not looking for a count of the number of items, I'm looking for the actual cell values to be in a single combined column.
    But thank you for replying.

    Here's an example file of what I'm trying to accomplish.
    The first sheet has simple data values - the alphabet.
    The second sheet has typical data values - they are part numbers

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combine multiple columns of data into one column

    This thread shows how to combine 2 and 3 lists into a single list.

    See if you can adapt it for your 5 lists.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    07-02-2014
    Location
    USA
    MS-Off Ver
    2013 Pro
    Posts
    6

    Re: Combine multiple columns of data into one column

    Quote Originally Posted by Tony Valko View Post
    This thread shows how to combine 2 and 3 lists into a single list.

    See if you can adapt it for your 5 lists.
    Tony - thanks, but OMG I can imagine what this would take to nest to 5 levels ( that's a lot of parentheses!) -
    never mind if I had to expand it to 7 or 9 columns as the boss was dreaming about out loud today...

    I was afraid that it would be something like this.
    I think that VBA is going to be the way to go ...

    Thanks
    PMB

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combine multiple columns of data into one column

    Quote Originally Posted by PMBottas View Post
    I think that VBA is going to be the way to go ...
    I agree!

    Good luck!

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Combine multiple columns of data into one column

    Hi,

    I can give you a single formula which will work for any number of columns, though it would be useful to first know the following:

    1) Are there ever any blank cells in between the data in any of the columns in question? (In your attached file there aren't, though that doesn't mean that it's not a possibility.)

    2) If there are any such blank cells, are these cells "genuinely" blank, or do they perhaps contain formulas in them which may result in ""?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Combine multiple columns of data into one column

    Here's another possibility.

    I just reread the original post and it appears you want to end up with just the unique values from the combined lists.

    See if this does what you want.

    Data Range
    A
    B
    C
    D
    E
    F
    1
    List1
    List2
    List3
    ------
    Count
    Uniques
    2
    A
    A
    B
    9
    A
    3
    B
    C
    D
    B
    4
    D
    E
    E
    C
    5
    F
    G
    G
    D
    6
    H
    E
    7
    I
    F
    8
    G
    9
    H
    10
    I
    11


    Enter this array formula** in E2. This will return the count of the unique entries in the range.

    =SUM(IF(A2:C7<>"",1/COUNTIF(A2:C7,A2:C7)))

    Enter this array formula** in F2:

    =IF(ROWS(F$2:F2)<=E$2,INDEX(A$2:C$7,MIN(IF(A$2:C$7<>"",IF(ISNA(MATCH(A$2:C$7,F$1:F1,0)),ROW(A$2:C$7)-ROW(A$2)+1))),MOD(MIN(IF(A$2:C$7<>"",IF(ISNA(MATCH(A$2:C$7,F$1:F1,0)),(ROW(A$2:C$7)-ROW(A$2)+1)*10^5+(COLUMN(A$2:C$7)-COLUMN(A$2)+1)))),10^5)),"")

    Copy down until you get blanks.

    Still a pretty hefty formula but might be a bit shorter than the other formula.

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    The formula references cell F1. Cell F1 must not contain an entry that is also within the data range. Typically, cell F1 would be a column header.

  9. #9
    Registered User
    Join Date
    07-02-2014
    Location
    USA
    MS-Off Ver
    2013 Pro
    Posts
    6

    Re: Combine multiple columns of data into one column

    Tony,
    Thanks, I'll check it out.

+ 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: 3
    Last Post: 09-03-2013, 11:53 AM
  2. Combine multiple columns of data into one column???
    By seedman76 in forum Excel General
    Replies: 4
    Last Post: 03-07-2013, 02:20 AM
  3. Combine multiple columns into one column with header and date in another column
    By JJadams in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-12-2012, 05:30 PM
  4. Replies: 4
    Last Post: 01-12-2012, 12:30 AM
  5. Replies: 0
    Last Post: 07-31-2006, 12:13 PM

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