+ Reply to Thread
Results 1 to 11 of 11

Sorting Main Categories and Associated Sub-Catagories

  1. #1
    Registered User
    Join Date
    03-08-2020
    Location
    Devon, UK
    MS-Off Ver
    14.0.7237.5000 (32 bit)
    Posts
    25

    Sorting Main Categories and Associated Sub-Catagories

    I'm trying to create a list with both main categories and associated sub-categories that can be sorted, occasionally. I've attached a draft example (I hope!). If I sort my table on the basis of the first column as the first level and the second column as the second level, I end up with items in the second column being disassociated with their first column groups.

    Is there a way of 'locking' items in the second column to their correct first column groups so that the association is not lost on sorting?
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sorting Main Categories and Associated Sub-Catagories

    This is a new one.

    We often have inadequate information, but rarely a completely empty workbook.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-08-2020
    Location
    Devon, UK
    MS-Off Ver
    14.0.7237.5000 (32 bit)
    Posts
    25

    Re: Sorting Main Categories and Associated Sub-Catagories

    Thanks for your reply Richard and for pointing out my mistake. I'll have another go at sending the workbook. I think that I have followed the manage attachements instruction. I checked in 'Preview Post' and it showed there.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,006

    Re: Sorting Main Categories and Associated Sub-Catagories

    Don't put form before function!

    Here's the easiest and best way to organise the lists (and they will filter nicely once you add filters to the column headers):

    Excel 2016 (Windows) 32 bit
    A
    B
    3
    Food Group Food
    4
    Dairy Butter spread
    5
    Dairy Milk FF
    6
    Dairy Milk SS
    7
    Dairy Cheese - Cheddar
    8
    Vegetables Potatoes
    9
    Vegetables Carrots
    10
    Vegetables Broccoli
    11
    Fruit Apples
    12
    Fruit Tangerines
    13
    Fruit Bananas
    Sheet: Sheet1
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    03-08-2020
    Location
    Devon, UK
    MS-Off Ver
    14.0.7237.5000 (32 bit)
    Posts
    25

    Re: Sorting Main Categories and Associated Sub-Catagories

    Thanks, Ali that's a very simple and effective solution. Why didn't I think of that! Can you tell me a bit more about filters and how to use them, please?

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sorting Main Categories and Associated Sub-Catagories

    ...and to follow up Ali's point the easiest way of achieving this is

    1. Select A4:A13
    2. Press F5 Goto, Select Special and then Blanks
    3 . The Cursor will be in A5 (the first blank). enter "=" followed by the up arrow
    4. Ctrl & Enter

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sorting Main Categories and Associated Sub-Catagories

    Quote Originally Posted by Kalkul8 View Post
    Thanks, Ali that's a very simple and effective solution. Why didn't I think of that! Can you tell me a bit more about filters and how to use them, please?
    As well as exploring filters check out Inserting a simple Pivot Table - see attached

    It may not be particularly relevant for this simple task, but where you have several columns of data and need to Filter, Sort, Total, Count...etc.. i.e.derive some analysis of the data it will provide huge dividends in the future.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-08-2020
    Location
    Devon, UK
    MS-Off Ver
    14.0.7237.5000 (32 bit)
    Posts
    25

    Re: Sorting Main Categories and Associated Sub-Catagories

    Thanks for your reply, Richard. I followed your steps and got the blanks in column A filled appropriately. This is a 'filter' that I've applied?
    Attached Files Attached Files

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sorting Main Categories and Associated Sub-Catagories

    Just select A3, Click Sort accepting the default 'Food' field, the default My data has headers, and the default A-Z Order and click OK

  10. #10
    Registered User
    Join Date
    03-08-2020
    Location
    Devon, UK
    MS-Off Ver
    14.0.7237.5000 (32 bit)
    Posts
    25

    Re: Sorting Main Categories and Associated Sub-Catagories

    ...that's wrapped it up nicely Richard. Thanks to you and Ali.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,006

    Re: Sorting Main Categories and Associated Sub-Catagories

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Sorting into categories
    By ZarinaSa in forum Excel General
    Replies: 1
    Last Post: 05-09-2018, 07:53 AM
  2. sorting with categories
    By stephme55 in forum Excel General
    Replies: 12
    Last Post: 10-03-2015, 06:08 PM
  3. Help with a formula, sorting in to catagories
    By lalagirl180 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-07-2013, 03:37 PM
  4. Replies: 2
    Last Post: 06-05-2013, 04:19 PM
  5. Automate moving certain criteria into main categories
    By dgross102 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2013, 03:58 PM
  6. Sorting into categories
    By AHSinVT in forum Excel General
    Replies: 2
    Last Post: 01-17-2006, 12:10 PM
  7. sorting by 4 categories
    By JT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-05-2005, 11:06 AM

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