+ Reply to Thread
Results 1 to 20 of 20

Combining data in multiple columns(all columns have same length)into one column

  1. #1
    Registered User
    Join Date
    04-07-2014
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    25

    Combining data in multiple columns(all columns have same length)into one column

    Hello Folks ,

    This is the problem. I have data in about 650 columns like so

    1 2 3 .....................................650
    0.00 0.00 0.00
    0.00 0.00 0.00
    0.00 0.00 1.00
    0.79 1.00 0.00
    0.00 0.00 0.00
    0.00 0.00 0.00
    0.00 0.00 0.00
    0.00 0.00 0.00
    0.00 0.00 0.00
    0.00 0.00 0.00
    0.00 0.00 0.00
    0.00 0.00 8.00
    0.00 0 4.01
    0.00 0 0
    0.00 0 0
    0.00 0 2
    0.00 0 0
    0.00 0.49 0
    0.00 0 0
    2.00 0 1
    0.00 0 0
    0.00 0 0
    0.00 0 0
    0.00 0 0

    And I want it to be like so in a (new) one column like so


    Data Point
    0.00 1
    0.00 1
    0.00 1
    0.79 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    2.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 1
    0.00 2
    0.00 2
    0.00 2
    1.00 2
    0.00 2
    0.00 2
    0.00 2
    0.00 2
    0.00 2
    0.00 2
    0.00 2
    0.00 2
    0 2
    0 2
    0 2
    0 2
    0 2
    0.490 2
    0 2
    0 2
    0 2
    0 2
    0 2
    0 2
    0.00 3
    0.00 3
    1.00 3
    0.00 3
    0.00 3
    0.00 3
    0.00 3
    0.00 3
    0.00 3
    0.00 3
    0.00 3
    8.00 3
    4.016 3
    0 3
    0 3
    2 3
    0 3
    0 3
    0 3
    1 3
    0 3
    0 3
    0 3
    0 3

    So the data in the new column should start with data from column 1 and end with column 650 . Any help is highly appreciated.

  2. #2
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Combining data in multiple columns(all columns have same length)into one column

    hi Nzi..

    I couldn't understand what you want to do with the data...
    try to elaborate.. with a small example.
    or an excel file...


    Don't forget to click *

  3. #3
    Registered User
    Join Date
    04-07-2014
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Combining data in multiple columns(all columns have same length)into one column

    Sorry about the confusion. I cannot attach the original file because it is too large. But I am attaching an example file to illustrate the problem. Hopefully this will explain the issue better.
    Attached Files Attached Files

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,701

    Re: Combining data in multiple columns(all columns have same length)into one column

    Assuming your data starts A1 insert a column before data (you need space for results) and in A1 write formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    (if there is more than 23 rows adjust two 23's and one 24 in formula accordingly)

    and copy down 650*23 =14950 rows: Position cursor in A1, press Ctrl+G, in reference write A1:A14950 , click OK and (with all destination range selected) press Ctrl+D
    Attached Files Attached Files
    Last edited by Kaper; 07-23-2014 at 11:19 AM.
    Best Regards,

    Kaper

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Combining data in multiple columns(all columns have same length)into one column

    Maybe?

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-07-2014
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Combining data in multiple columns(all columns have same length)into one column

    Thank you so much Kaper, I am trying your solution out now.

  7. #7
    Registered User
    Join Date
    04-07-2014
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Combining data in multiple columns(all columns have same length)into one column

    Thanks a lot John H. Davis. The code almost works. But I do not want the column headers i.e. 1 2 3 4 etc in the new single column. Any way around that ?

  8. #8
    Registered User
    Join Date
    04-07-2014
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Combining data in multiple columns(all columns have same length)into one column

    Kaper after messing your code a bit it is now working perfectly! Thank you so much ! I really appreciate it!

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Combining data in multiple columns(all columns have same length)into one column

    Which rows contain your headers? As it stands it copies from row 2 down.

  10. #10
    Registered User
    Join Date
    04-07-2014
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Combining data in multiple columns(all columns have same length)into one column

    John H. Davis, thank you again for your quick reply. I ran the code and it seems it is missing the first row of every column except the first one so when I ran the code on this ( starting at A1) data

    a d g j
    b e h k
    c f i l

    I get

    a
    b
    c
    e
    f
    h
    i
    k
    l

    d g and h gets lost.

  11. #11
    Registered User
    Join Date
    04-07-2014
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Combining data in multiple columns(all columns have same length)into one column

    John H. Davis, thank you again for your quick reply. I ran the code and it seems it is missing the first row of every column except the first one so when I ran the code on this ( starting at A1) data

    a d g j
    b e h k
    c f i l

    I get

    a
    b
    c
    e
    f
    h
    i
    k
    l

    d g and h gets lost.

  12. #12
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Combining data in multiple columns(all columns have same length)into one column

    You said you didn't want the Column headers (Post #7). It assumes you have a Column Header in row 1? If you want to pick up row 1 data then change this:

    Please Login or Register  to view this content.
    to this:

    Please Login or Register  to view this content.

  13. #13
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,701

    Re: Combining data in multiple columns(all columns have same length)into one column

    Keeping in mind that all columns are the same length, you can rewrite a bit John's code (for data starting in B1) - hope it is a bit easier to read for "less advanced" VBA user:

    Please Login or Register  to view this content.
    PS. I'm Glad that formula solution worked for you too.

  14. #14
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Thumbs up Re: Combining data in multiple columns(all columns have same length)into one column

    Got the solution...
    Check the attached file...

    Read the formula carefully..
    its purely mathematical...
    and only one of its kind..( I hope so...)


    Don't forget to click *
    Attached Files Attached Files

  15. #15
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Combining data in multiple columns(all columns have same length)into one column

    Simply drag down both the formulas to include other columns in the result..


    Regards
    Vikas Gautam

  16. #16
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Combining data in multiple columns(all columns have same length)into one column

    Another using an array..

    Please Login or Register  to view this content.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    04-07-2014
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Combining data in multiple columns(all columns have same length)into one column

    John Davis this work perfectly! Thanks a million!

  18. #18
    Registered User
    Join Date
    04-07-2014
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Combining data in multiple columns(all columns have same length)into one column

    This works as well! Fantastic!

  19. #19
    Registered User
    Join Date
    04-07-2014
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Combining data in multiple columns(all columns have same length)into one column

    Vikas_Gautam thank you for your help as well. I have not tried it out yet.But I am sure it will work!

  20. #20
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Combining data in multiple columns(all columns have same length)into one column

    You're welcome. Glad to help out and thanks for the feedback. Please mark this thread as solved.

+ 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. combining multiple columns into column on new tab
    By bruno08102013 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-26-2014, 05:27 PM
  2. Combining multiple rows from 2 columns into sorted columns depending on 1st columns value
    By Dexamphetamine in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-11-2013, 10:00 AM
  3. [SOLVED] Combining multiple columns of data into single column
    By dsklein85 in forum Excel General
    Replies: 6
    Last Post: 10-30-2012, 11:18 PM
  4. Combining multiple columns into one column
    By Casper_DK in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-11-2011, 05:39 AM
  5. Combining multiple length columns to one
    By Wingman in forum Excel General
    Replies: 5
    Last Post: 05-09-2006, 09:10 PM

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