Advanced Sorting in Excel

Advanced Sorting in Excel

I have a data in excel in the format:

Description      Name            Percent
Always             A               52
Sometimes          A               23
Usually            A               25      
Always             B               60
Sometimes          B               30
Usually            B               15 
Always             C               75
Sometimes          C               11
Usually            C               14

I want to sort this data:

For each name the sequence of description has to be same (eg: always followed by sometimes followed by usually) but for three names A, B and C, I want to sort the always percent from smallest to largest. Eg: I want the above example to look like this after sorting:

Description      Name            Percent
Always             C               75
Sometimes          C               11
Usually            C               14      
Always             B               60
Sometimes          B               30
Usually            B               15 
Always             A               52
Sometimes          A               23
Usually            A               25

The always percent of name C was highest and always percent of name A was lowest. I hope I was able to explain it. I would really appreciate your help regarding the same.

3 Answers

You can do a three level sort to solve this

  1. By Name {z to a}
  2. By Description (click on Custom List, then enter in Always, Sometimes, Usually)
  3. then by Percent (smallest to largest)

Pls see screenshot (from xl2010 below)

6

I can't see a one-step approach, but try the following... (It's actually not as complicated as it looks: it's just hard to explain both succinctly and clearly!)

It is based on the assumption that the rows in the initial data are always in the desired relative order, i.e.

  1. Always
  2. Sometimes
  3. Usually

If this is true (rather than a coincidence in your example data), then you can create a 4th column, for the purposes of sorting, that generates numbers that can be sorted in your desired order.

Summary of approach

  1. Create a new column, containing data derived from your Percent values, that will retain the desired order of each set of 3 rows during sorting
  2. Convert the cells in this new column from formulae to values, so the values are not changed during the sort
  3. Sort the data on this new column (descending), with Name as the second sort key.
Elena Rostova
Author

Elena Rostova

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.