SORTBY problems

ollyhughes1982

Well-known Member
Joined
Nov 27, 2018
Messages
795
Office Version
  1. 365
Platform
  1. MacOS
Hi,

I am attempting to SORTBY function, but don’t seem to be able to get it to work. Please could someone show me where I am going wrong.

The current formula I am using is:
Excel Formula:
=IF(A2="","",IFERROR(SORTBY(B2:B10001,'Sort List'!A2:A10001),""))

In column D of the ‘Unique Character Extraction’ worksheet, I am trying to sort (spilling down) the non-blank cells from the range B2:B10001t. I have set the order I would like them sorted by in A2:A69 of the second worksheet (‘Sort List’), but it doesn’t seem to be working. For some reason it is showing ‘8’ first ands then a seemingly random order after that, including 0 values. It should sort as I have set in the second worksheet. I assumed SORTBY was the correct function for this, but doesn’t seem to be working.

Screenshot 2024-05-14 at 17.57.39.jpg
Screenshot 2024-05-14 at 17.57.59.jpg


Any help much appreciated!

I’ve also added a link to the file: parkrun - Extract Unique Characters.xlsx

Thanks in advance!

Olly.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I now have a found a way to do this, but I am now trying to remove the 0 results that I get. in have added IFERROR and an IF, but i am still getting 0 values in the remaining cells.

This is my formula:
Excel Formula:
=IF(B2="","",IFERROR(SORTBY(B2:B10001,MATCH(B2:B10001,'Sort List'!A2:A10001,0)),""))
 
Upvote 0
Maybe this.
Excel Formula:
=SORTBY(B2#,UNICODE(B2#))
 
Upvote 0
So
Excel Formula:
=IF(B2="","",IFERROR(SORTBY(B2#,UNICODE(B2#)),""))
?

This doesn't reference my custom list on the second sheet though?

Or like this?
Excel Formula:
=IF(B2="","",IFERROR(SORTBY(B2#,UNICODE(B2#)),MATCH(B2:B10001,'Sort List'!A2:A10001,0)),""))
 
Upvote 0
Your list on the Sort List tab isn't exactly custom. Isn't it just getting the ASCII code of the character?
 
Upvote 0
No, it's a different order to the standard sort. It's the way I need to do it. My solution has it sorting correctly, I just want to be able to get rid of the zero values at the bottom that go all of the way to the end of the range.
 
Upvote 0
I'm not following. I don't see how your column B on the Sort List is different than the standard sort?
 
Upvote 0
I’ve solved the sort order with my match function. I just need to amend it to remove the unwanted zero values
 
Upvote 0
Ok, did the TOCOL solve the zero value?
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

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