+ Reply to Thread
Results 1 to 6 of 6

Excel Sort Grouping

  1. #1
    Registered User
    Join Date
    01-21-2014
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Excel Sort Grouping

    Hi All,

    I have a bunch of data like this.
    Imagine the | as separator for each cell

    Player | Number | GPA | IQ Score
    Raul |17 |4.0 |190
    Deigo |69 |1.0 | 60
    Number| Player | GPA | IQ Score
    16 | Abe | 1.3 | 165
    89 |John | 2.3 |169

    So basically, is there a way to sort them all to look like this???

    Player | Number | GPA | IQ Score
    Raul |17 |4.0 |190
    Deigo |69 |1.0 | 60
    Abe |16 |1.3 | 165
    John |89 | 2.3 |169

    So, put all the data in the correct column, dictated by the first header???

    Thanks,
    Ka

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Excel Sort Grouping

    mokk083,

    Welcome to the Excel Forum.


    Detach/open workbook ReorgData rngobject 2ndtitlerowsColumnSwitched - mokk083 - EF983186 - SDG15.xlsm and run the ReorgData macro.


    If you want to use the macro on another workbook:


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code
    2. Open your NEW workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the ReorgData macro.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Excel Sort Grouping

    mokk083,

    So basically, is there a way to sort them all to look like this???

    Player | Number | GPA | IQ Score
    Raul |17 |4.0 |190
    Deigo |69 |1.0 | 60
    Abe |16 |1.3 | 165
    John |89 | 2.3 |169
    Sorry, I missed this part - be back later with an updated macro.

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Excel Sort Grouping

    mokk083,

    Detach/open workbook ReorgDataV2 rngobject 2ndtitlerowsColumnSwitched - mokk083 - EF983186 - SDG15.xlsm and run the ReorgDataV2 macro.


    If you want to use the macro on another workbook:


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the ReorgDataV2 macro.

  5. #5
    Registered User
    Join Date
    01-21-2014
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Excel Sort Grouping

    Oh thank you for the quick reply stanley.
    I didn't think it would be a VBA solution. Sadly, the headers I gave were all superficial. The real headers are 15 columns long, so I don't know if you still want to do it...|Term|Level|Last Name|Marketing Source All|(+)Marketing Source Original|Program 1|Marketing Source Most Recent Date|Marketing Source Most Recent|E-mail|First Name|Degree 1|(+)Inquiry Date School 1|Entry Status|Source Code

    I won't need this until next week, so if you DO decide to do it, thanks in advance.
    I just wish there was a more user friendly feature in Excel to do this type of data sorting. To me, it seems like a pretty common issue that can save workers a lot of time.

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Excel Sort Grouping

    mokk083,

    It is always best to display your actual raw data, and, what the results should look like. This way a solution can usually be found on the first go.


    I didn't think it would be a VBA solution.
    You did not specify in your original thread that you wanted a formula solution.

    In the Quick Reply box, just put the word BUMP. Then, click on the Post Quick Reply button, and someone else will assist you.



    If you want me to continue with a macro solution for your new dataset, then I will have to see your actual raw data workbook.

    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed/changed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.

    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

    To attach your workbook, scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.

+ 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: 1
    Last Post: 02-26-2013, 05:07 AM
  2. Excel 2007 : Data Sort with Two Row Grouping?
    By jisbell5 in forum Excel General
    Replies: 5
    Last Post: 09-13-2011, 03:31 PM
  3. Sort by Value (Col C) and Keep Grouping (Col A)?
    By shifty646 in forum Excel General
    Replies: 2
    Last Post: 06-29-2011, 11:42 AM
  4. Sort and grouping
    By CESAR V. ARROYO in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2010, 01:55 PM
  5. [SOLVED] Sort by grouping
    By rreneerob in forum Excel General
    Replies: 1
    Last Post: 09-16-2005, 05:05 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