Here is a solution I came up with to sort a list by group totals in Excel by using a specific format for the totals row and a formula inserted in a column to accomplish the task.
In each total row, I added the bank name with the underscore character between each word of the name, and an asterisk at the end, for example, " First_American_Bank Total*". The underscore characters cause the row to sort to the bottom of each group when the bank name column is sorted in ascending order. The asterisk is used by the formula to display the total for each row of the group.
In my attached example, the formula causes every row in column C to show the total number of loans for the specific bank. In cell C2, the formula reads:
=IF(RIGHT(A2,1) = "*",B2,C3)
translated: if this row has an asterisk at the end, it is a total row so display the total found in column B, otherwise display the value in the next cell down in column C.
When you sort by the formula in column C as the primary sort column in descending order , and by "Bank Name" as the secondary sort column in ascending order, you get the largest loan totals at the top, and banks with the same loan totals will be sorted alphabetically in ascending order.
Jerry
The great French sculptor Rodin once explained how to carve a statue of a horse. “Get a block of marble, take a hammer and a chisel, and cut away everything that doesn’t look like a horse.”