Select the rows that you wish to collapse, then click on the Data tab and Groups in the Outline group, and then click on Group Rows. You will see a '-' sign on the left of column A. When you click on the '-' sign, the selected rows get collapsed.
What is the shortcut to collapse rows in Excel?
To collapse a group in Excel, first select the cells that you want to collapse. Then, press the Alt + Shift + Left Arrow keys on your keyboard.