Sorting ascending in proper numerical format for a range

WxShady13

Board Regular
Joined
Jul 24, 2018
Messages
184
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I have a LOS Range field (0-1,2-3,4-5,6-7, etc) that I need to sort properly. I have it as a text field so it will show the range but I do not have another field that I can use to sort it numerically. How do I get it to list in proper order?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
If you go over 10, then it will not sort correctly, because in alphabetic sorting, values like: "10-11" will come before "2-3".

One way around this is to create a "helper" column that pulls off the first number, and sort by this.
So, if you enteries were in column A, starting on row 2, you could put this formula in any blank cell in row 2:
=LEFT(A2,FIND("-",A2)-1)+0
and copy down for all rows.

Then, use this column for your sorting.
If you do not want to display it, you can hide this column.
 
Upvote 0
My range column is only present in the Power BI environment and not excel. I tried this formula
LOSHelper = left(Table1[LOS Range],Find("-",Table1[LOS Range])-1)+0 but it comes back with "The search Text provided to function 'Find' found not be found in the given text." Any idea what is causing that?
 
Upvote 0
Here is what the LOS Range field looks like
LOS Range.png
 
Upvote 0
did you read post#5 ?

or post a link to the shared pbix file using onedrive, googledrive, dropbox or any similar
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top