If the Subtotals command is grayed out, that’s because subtotals can’t be added to tables. But there’s a quick way around this. Convert your table to a range of data. Then you can add subtotals.
Just remember, converting to a range takes away the advantages of a table. Formatting, like colored rows, will remain, but things like filtering will be removed.
Click a cell in your table, and on the Table tab, click Convert to Range.
Click Yes in the box that appears.
Add subtotals to your data
Now that you’ve removed the table functionality from your data, you can add your subtotals.
Click one of the cells containing your data.
Click Data > Subtotal.
In the Subtotal box, click OK.
Tips: Once you’ve added your subtotals, an outline graphic appears to the left of your data. You can click on the number buttons along the top of the graphic to expand and collapse the data.
Tip: If you decide you don’t want subtotals, you can remove them by clicking anywhere in the data, clicking Data > Subtotal, and then in the Subtotal box, click Remove All.