A more specific term for this kind of grouping in Excel is Outlining

Yes, this can be done.