...
To add a sort formula, click Add Formula, then use the formula editor to make a composite field to sort on.
...
You may want to sort groups by the summary, or aggregate, calculation of each group. You can do this using Top/Bottom filters.
Top/Bottom filters look for the highest or lowest values in a set, and then put those values in order. You can supply any arbitrary cell in the report in the Top/Bottom filter. So if you set the number of displayed values to "infinity", then no values are excluded, but the ordering still takes effect.
...