Tip! If you want to use the sorted output dynamically, you should use the SORT function. The formula is [[=SORT (range, sort_column, is_ascending)]]
[[range]]: range you want to sort (for example, A2:G31)
[[sort_column]]: position of the column you want to sort within your defined range (for example, 2)
[[is_ascending]]: can be true or false and determines if the range is sorted in an ascending way (or not)
Example: [[=SORT (A2:G31, 2, true)]]