Forum Discussion
bernidakis
Aug 19, 2022Copper Contributor
Complicated sorting
Hello
I'm trying to sort some data, i have multiple columns that i want to use for the sort.
I used the SORT function to sort by one column but then i want if 2 or more of the values are equal to sort the equal lines by values of anoter column. For example
name1 3 4
name2 3 5
name3 2 3
Now the range is sorted by 2nd column but because 2 of the values are equal i want it to sort these 2 lines by 3rd column so name2 to go first on the list.
Can this happen by functions or i have to use code?
all best
bernidakis It will stay at the bottom, indeed. Just give it a try yourself. Otherwise play around with the attached file.
- Riny_van_EekelenPlatinum Contributor
bernidakis If you have SORT you should also have SORTBY. The fist argument is the array you want to sort, followed by pairs of columns and sort order.
Something like this:
- bernidakisCopper ContributorBut if in line 4
name3 2 6
then will it go to the top or it will stay at bottom as it should?- Riny_van_EekelenPlatinum Contributor
bernidakis It will stay at the bottom, indeed. Just give it a try yourself. Otherwise play around with the attached file.