+ Reply to Thread
Results 1 to 10 of 10

Merging Multiple Columns Into a Single Column

  1. #1
    Registered User
    Join Date
    04-25-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Merging Multiple Columns Into a Single Column

    I have multiple columns of data that I need to merge into one column. These data is composed of water flows from pumps that were recorded at different times.

    PUMP1
    Column A
    Time
    12:00
    12:32
    12:47
    12:54
    etc

    PUMP1
    Column B
    Flow
    32
    23
    31
    33
    etc

    PUMP 2
    Column C
    Time
    12:03
    12:32
    12:40
    12:54
    etc

    PUMP2
    Column D
    Flow
    43
    42
    46
    44
    etc

    As you can see, the time the readings were taken could be the same or different. I would like to combine Columns A and C into one column that combines all the times that readings were taken but delete duplicate times. I would basically like to create a Column E that looks like Column E, below. Then I will use a Vlookup to match pump flows to the times in Column E. There are around 35,000 entries, so I can't do this manually.

    Column E
    12:00
    12:03
    12:32
    12:40
    12:47
    12:54

    Any help would be greatly appreciated!

  2. #2
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Merging Multiple Columns Into a Single Column

    All you datas starts after third row

    for time
    =IFERROR(IFERROR(SMALL(IF(ISERROR(MATCH($A$3:$A$6,$E$1:E1,0)),$A$3:$A$6,""),1),
    SMALL(IF(ISERROR(MATCH($C$3:$C$6,$E$1:E1,0)),$C$3:$C$6,""),1)),"") CSE

    for flow
    =IFERROR(IFERROR(SMALL(IF(ISERROR(MATCH($B$3:$B$6,$F$1:F1,0)),$B$3:$B$6,""),1),
    SMALL(IF(ISERROR(MATCH($D$3:$D$6,$F$1:F1,0)),$D$3:$D$6,""),1)),"")

    Simulated in file
    Attached Files Attached Files
    Appreciate the help? CLICK *

  3. #3
    Registered User
    Join Date
    04-25-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Merging Multiple Columns Into a Single Column

    Quote Originally Posted by AZ-XL View Post
    All you datas starts after third row

    for time
    =IFERROR(IFERROR(SMALL(IF(ISERROR(MATCH($A$3:$A$6,$E$1:E1,0)),$A$3:$A$6,""),1),
    SMALL(IF(ISERROR(MATCH($C$3:$C$6,$E$1:E1,0)),$C$3:$C$6,""),1)),"") CSE

    for flow
    =IFERROR(IFERROR(SMALL(IF(ISERROR(MATCH($B$3:$B$6,$F$1:F1,0)),$B$3:$B$6,""),1),
    SMALL(IF(ISERROR(MATCH($D$3:$D$6,$F$1:F1,0)),$D$3:$D$6,""),1)),"")

    Simulated in file
    Thank you! Your code is definitely pretty impressive! I am trying to apply it to my data and it is not working. If I cut and paste your formula and apply it to your excel file you attached, it does not seem to be working either. What am I missing?

  4. #4
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Merging Multiple Columns Into a Single Column

    Maybe you do not hit Ctrl+Shift+Enter keys at the same time. Formulas above are array formulas, thus after formula press C+S+E, not only enter

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Merging Multiple Columns Into a Single Column

    This can be done by a code. How comfortable are you with using a code?

  6. #6
    Registered User
    Join Date
    04-25-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Merging Multiple Columns Into a Single Column

    Quote Originally Posted by AZ-XL View Post
    Maybe you do not hit Ctrl+Shift+Enter keys at the same time. Formulas above are array formulas, thus after formula press C+S+E, not only enter
    That was it, it appears to work now! I just had to hit Ctrl+Shift+Enter;I just didn't know array formulas needed the CSE. Thank you so much

  7. #7
    Registered User
    Join Date
    04-25-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Merging Multiple Columns Into a Single Column

    Quote Originally Posted by AB33 View Post
    This can be done by a code. How comfortable are you with using a code?
    Although, AX-XL solution worked. I would be interested to know know a code solution would work. Unfortunately I haven't worked with any excel code since college, so I am a bit rusty.

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Merging Multiple Columns Into a Single Column

    If AX-XL solution worked, no need for complication. Avoid a VBA if you can is the motto of the day.

  9. #9
    Registered User
    Join Date
    04-25-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Merging Multiple Columns Into a Single Column

    Quote Originally Posted by AB33 View Post
    If AX-XL solution worked, no need for complication. Avoid a VBA if you can is the motto of the day.
    It worked great in my test. Then I applied it to the whole range of data ~37,000 rows and the calculation time has gone through the roof. It takes approximately 7 min to calculation 500 rows...

  10. #10
    Registered User
    Join Date
    04-25-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Merging Multiple Columns Into a Single Column

    Well, I think I just figured out a simple and quick way to do this. Excel 2007 apparently has a "remove duplicates" button in Data/Data Tools. It appears I can just copy Column A under the last entry in Column C and then hit the remove duplicates button for Column C. Then I can sort the column with the "A to Z" sort button and bingo. Excel performs the duplicate button function for the 37,000 rows in less than a second. The sort button goes even faster.

    While AX-XL is spiffy and definitely works, it would take hours to perform the array function on my computer with large amount of data involved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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