To do Alt + A B on Mac in Excel, download and install Accelerator Keys, then press Option, followed by A, B.
Command: Subtotal
This is how to do Alt + A B on Mac in Excel with Accelerator Keys, the native ribbon and alt key shortcut solution for Mac users who get more done with Excel.
Alt + A B opens the Subtotal dialog. This feature automatically inserts subtotal rows into your sorted data, calculating sums, averages, counts, or other aggregations for each group. It also creates an outline for easy expanding and collapsing of detail rows.