+ Reply to Thread
Results 1 to 4 of 4

How to sort blocks of cells by the cell in the row above the corresponding cells.

  1. #1
    Registered User
    Join Date
    05-06-2017
    Location
    Columbia, MO
    MS-Off Ver
    2016
    Posts
    2

    How to sort blocks of cells by the cell in the row above the corresponding cells.

    I want to sort the meals in the "Meals" sheet by the meal name above each meal "block" of ingredients. I want the category, food item, portion, measure, etc to stay with their corresponding meal name when sorted. I have attached the spreadsheet. Any suggestions would be much appreciated. Thank you.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to sort blocks of cells by the cell in the row above the corresponding cells.

    I cannot open your file.

    It may be corrupted. Please reload it.

    You will need a macro.

    Process:

    Put a formula into a helper row

    Copy the Meal Names into a new column and sort them
    In the next column number each meal sequentially

    Use a Match Formula in a new column to transfer the Sequential number into a column adjacent to the Meal Name.

    Use another formula to number all meals and their ingredients.

    Shephards Pie = 1
    Minced Beef 1.1
    Mashed Potato 1.2
    Carrots 1.3
    Onions 1.4
    1.5
    Beef Stew 20
    Minced Beef 20.1
    Diced Potato 20.2
    Carrots 20.3
    Onions 20.4
    20.5

    Finally sort by this column.
    Last edited by mehmetcik; 05-07-2017 at 04:30 AM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,372

    Re: How to sort blocks of cells by the cell in the row above the corresponding cells.

    Similar approach to mehmetcik: I'd add 3 columns. In the first, repeat the meal number; in the second, repeat the meal name; and, in the third, add an index/counter for each entry in the meal including the header row and the meal summaries. You'll need to index the blank rows. Then you can sort on meal name, meal content, whatever and, if you wish, return to the original state by sorting on meal number and index.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    05-06-2017
    Location
    Columbia, MO
    MS-Off Ver
    2016
    Posts
    2

    Re: How to sort blocks of cells by the cell in the row above the corresponding cells.

    Thank you for your timely replies. I will try your suggestions as soon as I can!

+ 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. [SOLVED] Sort by named range or blocks of data with merged cells?
    By donkey33 in forum Excel Formulas & Functions
    Replies: 31
    Last Post: 08-11-2016, 08:47 AM
  2. cell references summing blocks of 7 cells
    By ruperupe in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-07-2013, 10:23 AM
  3. Easy Way To Sort Each Of Multiples Cell Blocks
    By EdAROC in forum Excel General
    Replies: 0
    Last Post: 11-01-2011, 11:28 AM
  4. Replies: 6
    Last Post: 09-08-2010, 04:49 PM
  5. Transposing blocks of cells
    By parkinsc in forum Excel General
    Replies: 1
    Last Post: 10-05-2007, 01:29 PM
  6. Have blocks of blue colored cells ... want them surrounded by lavender-colored cells
    By rocket1406 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-01-2007, 03:59 PM
  7. How Do I Sort Cell Blocks in Ascending Order?
    By budward in forum Excel General
    Replies: 4
    Last Post: 10-28-2006, 07:22 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