//XL, SetGroup, rowfirst=##, rowlast=## {,collapsed} {,summary {=#}}
This directive creates a row group that can be collapsed or expanded. If the collapsed argument is specified, the group will be initially collapsed when viewed in the spreadsheet application; else expanded. The summary option determines whether the spreadsheet app should allow for a summary line and where, above or below. Specifying the summary argument by itself, or summary=1, puts the summary below the group; summary=-1 puts it above. Note that you have to create the summary line yourself and insert it in the proper order. For example,
Conference,Team,Wins,Payroll($M)
AFC,Ravens,10,87
AFC,Patriots,10,79
AFC,Bill,9,82
//XL,SetGroup,rowfirst=2,rowlast=4,collapsed,summary
AFC,"","",=SUM(D2:D4)
NFC,49ers,10,93
...
In the above example we have column titles and 3 data rows, followed by the SetGroup directive after the data rows it relates to. Following that is the summary line for the group, and then the start of another group.