I have created a custom list and one of the items in the list contains a drop down menu.
containing apple,orange,banana,grapefruit
. This has the title fruit
. I then have modified the view where I want it to order by fruit
I want it to order by the order I have given it but instead it does it alphabetically. Is there anyway to overwrite the alphabetical order and do it in the order I put down?
3 Answers
No, there is not. (I'm assuming that with "drop down menu" you mean a choice column)
If you order by the choice column, the view will always be ordered alphabetically, either ascending or descending.
The only workaround that comes to my mind is adding a numeric prefix before each value, eg:
- 01 - apple
- 02 - orange
- 03 - banana
- 04 - grapefruit
You cannot achieve this by using your "Fruit" column alone. The best workaround i can think of is to try creating another Calculated column called say "Order". Set formula in the calculated column to such that if Fruit Column is Orange , Set "Order" column as 1 etc , depending on the order you want to specify. Now in your view OrderBy that calculated column.
See this Blog to know more about calculated columns.
Use a calculated column and the Contains formula.
Create a calculated column.
Enter the Contains formula. Below is a template to get you started. Replace [ColumnName] with the name of your column and Text with the choice value from the column. Match the choice entry with the number you would like the entry be associated with for sorting.
=IF([ColumnName]="TEXT",1,IF([ColumnName]="TEXT",2,IF([ColumnName]="TEXT",3,IF([ColumnName]="TEXT",4,IF([ColumnName]="TEXT",5,IF([ColumnName]="TEXT",6,IF([ColumnName]="TEXT",7,IF([ColumnName]="TEXT",8,IF([ColumnName]="TEXT",9)))))))))
Create a view and sort by the new calculated column.
For step-by-step instructions with screenshots view my post on sorting items in a list using the Contains formula. Post: http://jennyssharepointtips.wordpress.com/2014/11/21/create-a-custom-sort-using-the-contains-formula-in-a-calculated-column/