0

I'm completely new to sheets and am currently trying to set up a filter for a column. The column is set up to use dropdowns to pick a string.

What I'm trying to do is order it by the text, but not alphabetically. In the sheet shown I'm trying to filter it so that General shows, then Major General, Brigade General, etc etc. I'm not even sure if it's possible with filters at this rate.

https://docs.google.com/spreadsheets/d/1Mk0cV-Di-11oD_rEoGyShRL4PeR9kZccR3hBFdNiuKc/edit?usp=sharing

0

1 Answer 1

1

The easiest solution would probably be to create a Sort key column by using the match() function.

Choose View > Freeze > 2 rows and put this formula in cell B2:

=vstack( 
  "Sort key", 
  arrayformula(iferror(match( 
    E3:E, 
    { "General", "Major General", "Brigade General", "Raid Captain", "Active Duty", "Commander", "Lieutenant", "Sergeant", "Corporal", "Private" }, 
    0 
  ))) 
)

Then choose Data > Sort sheet > Sort sheet by column B.

See vstack(), arrayformula(), iferror() and match().

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.