SORT function with sort_order argument 0 as random
Hi. You could create a new option 0 as the sort_order argument of the SORT function. Today we have 1 for Ascending, -1 for Descending and then we would have 0 representing shuffle, random order.
Kenneth Barber commented
I would argue that 0 should be reserved for "no sorting". A spreadsheet might be set up so that the user chooses the sort order, and having a "no sorting" option would make writing this formula a bit easier.
Cristiano Galvão commented
I have a video using this way of shuffling data using SORTBY with RANDARRAY: https://www.youtube.com/watch?v=yJQ2VXI3IW4 (it's in Portuguese, but it contains the English version of the formula in a caption and inside the description).
A SHUFFLE function would be very intuitive for this, particularly for beginners, but since SORT function currently has no 0 argument, we could fit this need there. Maybe we could even have both implementations, like happens with LARGE 1 and MAX.
Peter Bartholomew commented
Don't you think SORT would be somewhat misleading. SHUFFLE would be more descriptive.
Another way of approaching the problem is
= SORTBY( Names, RANDARRAY( COUNTA(Names) ) )
Microsoft Excel Recalc or Die commented
Very good proposal Cristiano, random orders can be good to test the efficiency and robustness of great formulas!