[Solved] Sort a column based on list order

Discuss the spreadsheet application
Post Reply
ssar17
Posts: 13
Joined: Fri Oct 23, 2020 8:35 am

[Solved] Sort a column based on list order

Post by ssar17 »

I have a column that I want to sort in this order depending on the items in that column:

DEP, TRN, DEB, ATM, BP, 0, 1, 2, 3, 4, 5. 6, 7, 8, 9

I did create a list and added this to the sort optons: Custom sort (see attached file).

I am trying to leave Microsoft Excel and need this function before I make the switch.
Sort.PNG
Last edited by MrProgrammer on Wed Nov 04, 2020 10:09 pm, edited 3 times in total.
Reason: Tagged ✓ [Solved]
ssar17
OpenOffice 4.1.8 on Windows 10
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Sort a column based on list order

Post by RusselB »

From the Help file: Custom sort order
To define a custom sort order, choose Tools - Options - OpenOffice Calc - Sort Lists .
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
ssar17
Posts: 13
Joined: Fri Oct 23, 2020 8:35 am

Re: Sort a column based on list order

Post by ssar17 »

That is what I did to define this list but when I try to use this it does not seem to work.
ssar17
OpenOffice 4.1.8 on Windows 10
User avatar
MrProgrammer
Moderator
Posts: 4905
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Sort a column based on list order

Post by MrProgrammer »

ssar17 wrote:I have a column that I want to sort in this order depending on the items in that column:
   DEP, TRN, DEB, ATM, BP, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
I did create a list and added this to the sort optons: Custom sort (see attached file). I am trying to leave Microsoft Excel and need this function before I make the switch.
Sort.PNG
Sort.PNG (63.39 KiB) Viewed 1173 times
I am able to create this in the Calc → Sort lists option. Options are set with OpenOffice → Preferences on a Mac, Tools → Options on other platforms. Data then sorts as specified, with DEP though BP ahead of 0 through 9.
Screen Shot 2020-10-28 at 10.02.02.png
You do need to understand that a custom sort list only applies to text values. Numbers are always sorted numerically, and ahead of all text. Read section 1. Types of data in Ten concepts that every Calc user should know if you don't know the difference between the numeric value 25 and the text value 25. Use [Tutorial] Text to Columns to convert values between numbers and text.
ssar17 wrote:That is what I did to define this list but when I try to use this it does not seem to work.
"does not work" is not helpful in a forum; it only says what didn't happen. If you need any additional assistance attach a document demonstrating the difficulty (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the document itself). Explain what you have done, what result you see, and what result you expect. Indicate which sheet and which cells are not as you want/expect. Sometimes results are correct while expectations are incorrect.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the subject field. Select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Post Reply