Forum Discussion
SORTBY newb... Other solutions don't appear to apply??
SortBy() takes the source range, sort it based on another array and put result into new place in the same or another sheet. That's practically no limit on the size of the source range.
If to sort in place that could be done programmatically (VBA, OfficeScript) or manually by Data -> Sort. Here you may sort by helper column which map Urgent, High, etc on numerical order of which (e.g. using XLOOKUP); or here you may sort by color if that's more suitable.
So, depends on goals, do you need to sort in place or copy sorted data into another place.
- feyresonNov 05, 2025Copper Contributor
Thank you for your reply, Sergei!
In this instance, I am trying to sort in place as opposed to pushing the data to another place. I had hoped that SortBy could accomplish this in place, but the examples (and your information here) shows me that it can't.
I just want the sheet sorted by dropdown selection in place and I want it to do it dynamically, rather than using the filter sort manually.
- SergeiBaklanNov 06, 2025Diamond Contributor
Afraid that's VBA or Office if sort with button. If fully dynamically - VBA, but it's not clear what will be the trigger. Plus you won't have the control to sort or not to sort at this very moment.
- m_tarlerNov 05, 2025Bronze Contributor
You can also format it as a table (home -> Format as Table) or just add the quick filter dropdowns (Date -> Filter) and then you can sort or filter the rows and as for colors, you can use conditional formatting (if you didn't already) using custom formula and apply to the whole table and then using something like = $D1="High" where 1 is the first row of the applied to range and $D will 'lock' it to always look at that column and just needs to be set to the correct column
- feyresonNov 05, 2025Copper Contributor
Thanks for your reply, m_tarler!
I did use conditional formatting for the color change and that worked great!
I am exploring the quick filter option; that might be the option I have to use, but I really wanted to have it be dynamic, rather than manual.
- m_tarlerNov 06, 2025Bronze Contributor
so if the issue is that the regular sort and quick sort options are only alphanumeric based options (i.e. urgent, high, medium would be sorted either high, med, urgent or urgent, med, high based on alphabetical) then a simple option is to add another column and substitute numbers for the critical levels using XMATCH:
=XMATCH([critical level], {"Urgent","High","Medium","Low"})
I would make that critical level a list on a sheet and/or a Name so then you can make sure the same list is used for the drop down and the XMATCH
=XMATCH( [critical level], Critical_List )
then you can easily sort by that value column