1. Select cells to group (see cells A2:A4 in the screenshot).
2. Select Data -> Group (in Outline Group).
Or
Press Alt+Shift+Right Arrow and click OK.
3. Repeat the above steps and add group & outline to more sections.
4. To clear groups & outlines, select the same rows or columns, and Select Data -> Ungroup (in Outline Group).