Forum Discussion
buzzwack1959
Mar 08, 2024Copper Contributor
sortby
As far as i can work out "sortby" can only use 2 sort arrays, but i need to use 3 sort arrays, does anyone know if this is possible with Sortby
HansVogelaar
Mar 08, 2024MVP
You can specify many ranges to sort by. For example:
=SORTBY(A17:G250, I17:I250, 1, K17:K250, -1, M17:M250, 1, N17:N250, -1)
This will sort the range A17:G250, first ascending by I17:I250, then within that descending by K17:K250, next ascending by M17:M250 and finally descending by N17:N250.
buzzwack1959
Mar 09, 2024Copper Contributor
Thanks but excel 365 will NOT let me go beyond [using your example] column K, it will not permit me to add M and N it gives me the message "you can't change part of an array", i have set out my formula just as you have done but get that message thus not allowing me to go beyond two arrays to sort.
- HansVogelaarMar 09, 2024MVP
Try deleting the formula from the range first, then enter it anew.
- buzzwack1959Mar 11, 2024Copper Contributori did that, initially it would not work, however since i closed down the spreadsheet re-opened it and retyped the formula it has worked - thanks for your input!