Microsoft Office Tutorials and References
In Depth Information
To Sort a Table on Multiple Fields Using the Custom Sort Command
Excel allows you to sort on many ﬁ elds in a single sort operation. You can sort on a maximum of 256 ﬁ elds in a
single sort operation. For instance, the sort example that follows uses the Custom Sort command on the Sort & Filter
menu to sort the Silver Photography Accessories Sales Rep table by quota (column G) within gender (column B)
within sales area (column F). The Sales Area and Gender ﬁ elds will be sorted in ascending sequence; the Quota ﬁ eld
will be sorted in descending sequence.
The phrase, sort by quota within gender within sales area, means that the records in the table ﬁ rst are arranged
in ascending sequence by sales area (Inside and Outside). Within sales area, the records are arranged in ascending
sequence by gender (M or F). Within gender, the records are arranged in descending sequence by the sales rep’s quota.
In this case, Sales Area is the major sort key (Sort by ﬁ eld), Gender is the intermediate sort key (ﬁ rst Then by ﬁ eld),
and Quota is the minor sort key (second Then by ﬁ eld). Sorting a table on multiple ﬁ elds is illustrated below.
• With a cell in the
table active, click the
Sort & Filter button
on the Home tab on
the Ribbon to dis-
play the Sort & Filter
menu (Figure 5–39).
Sort & Filter
• Click the Custom
Sort command on the
Sort & Filter menu
to display the Sort
• When Excel displays
the Sort dialog box,
click the Sort by box
arrow to display the
ﬁ eld names in the
table (Figure 5–40).