One of the core uses of Excel is to insert data to analyze or visualize. For a large amount of data, there can be a lot of columns and rows. Sometimes we may need two or more distant columns to do our work. But we can not get them together as there are multiple columns in between. So one solution is we can hide those columns in between for the time being and unhide them later. In this article, we will learn how to group and hide columns in Excel according to our needs.
Download Practice Workbook
You can download the practice workbook from here.
3 Easy Methods to Group and Hide Columns in Excel
When there is a large amount of data having too many columns, in most cases, adjacent or neighboring columns are there for the same purpose or to calculate the final result. So we may need to categorize them in a certain way or group them. One good feature of grouping columns is we can hide them when we need to. There are actually three ways to Group and Hide columns in Excel. All the methods are described below with proper steps. For Example, we will use the following dataset to demonstrate.
1. Using Excel Ribbon
We can use Excel Ribbon to group and hide columns in Excel. We will need to follow the steps for that.
- First, we need to group the columns. For example, we want to hide the Product ID and Sold Amount. So we will group them first. So we will select the cell range from D4 to E9.
- Second, we will go to the Data tab in the Ribbon and select Group in the Outline section.
- Third, a small selection window will appear. We will select Columns and click on OK.
- Then we will see a small “-” mark has appeared on top of the sheet. This indicates our grouping is done.
- In the end, clicking on the “-” sign will hide the columns like in the image below. Here the “+” sign indicates the grouped columns are hidden there and we can expand.
2. Use of Keyboard Shortcuts
We can also use keyboard shortcuts to directly group the columns. We will follow the steps below.
- Firstly, we will select our columns. In our case, we will select columns D and E.
- Secondly, we will press Shift+Alt+Right Arrow.
- Thirdly, we will get the small Group We will select Columns and press OK.
- Lastly, we will get the columns grouped. We will click on the small dash (-) button to hide it.
- Excel Hide Columns with No Data (4 Effective Ways)
- How to Unhide Columns in Excel All at Once (4 Quick Ways)
- Excel Hide Columns Based on Cell Value without Macro
- How to Hide Columns with Button in Excel (4 Suitable Methods)
- Excel VBA to Hide Columns Using Column Number (6 Examples)
3. Applying VBA to Group and Hide Columns
If we are doing a large operation in excel using VBA, and we need to group and hide our columns for any reason, we can do it through this method. The steps are below.
- At first, we need to decide which columns to group and hide. Like the previous example, we will group and hide columns E and F. We will go to the Developer tab in the Ribbon and choose Visual Basic. A window will appear. Or we can directly trigger it by pressing Alt+F11.
- Next select Insert and then Module in that window. A small writing window will appear.
- Then in that window, we will write the following code:
Sub G_H() Columns("E:F").Group End Sub
Here you can give the respective field sequence you need instead of E and F.
- Now we will press Ctrl+S to save the file as Excel Macro-Enabled Workbook or as a .xlsm file.
- After that, we will again go to the Developer tab and select Macros. A window named Macro will appear.
- In the window select G_H and select Run.
- At last, we will get our column grouped. We will hide it by pressing the “-”.
- Again pressing the “–” sign will give us the following result.
Hide Columns in Excel Without Grouping
We can also hide the columns without grouping. Here are the methods.
1. Using Excel Context Menu
In this method, we select a column that we will hide. After selecting the column, right-click to get the Context menu. In the menu, we will select Hide and we will see our column will be hidden.
We will identify the hidden column with this sign in between two columns:
- Unhide Columns in Excel Shortcut Not Working (6 Solutions)
- Hide or Unhide Columns Based on Drop Down List Selection in Excel
- How to Hide Rows and Columns in Excel (10 Ways)
- Unhide Columns in Excel (8 Methods)
- Excel VBA: Hide Columns Based on Cell Value (15 Examples)
2. Use of Keyboard Shortcut
We can also use keyboard shortcuts to hide a column. Simply we will select a column and press Ctrl+O. The column will immediately hide.
Here we hide the B, D, and F columns with keyboard shortcuts.
3. Using Excel Ribbon
We can select a column or multiple columns, and go to Format in the Cells section in the Home tab. In format select Hide & Unhide. Here we will select Hide Columns and then we will see our column will hide.
After all the steps we will get the following result.
Things to Remember
- For all the grouping, we can’t go for multiple selections.
- We can’t hide multiple columns with Context Menu.
- The entire demonstration was done in Excel 365. So the interface may vary for different versions.
The article was all about How to Group and Hide Columns in Excel. We also showed the methods if you want to avoid grouping for hiding. If you have any sort of suggestions or you are still having trouble with any of these methods, let us know in the comments. Our team is ready to answer all of your questions. For any Excel-related problems, you can visit our website Exceldemy for all types of Excel-related problem solutions.
- Hide Extra Columns in Excel (4 Easy Ways)
- How to Hide Columns in Excel with Password (2 Easy Ways)
- Unhide All Columns with Excel VBA (8 Examples)
- How to Hide Unused Columns in Excel (5 Quick Tricks)
- Unhide Columns Is Not Working in Excel (4 Issues & Solutions)
- How to Collapse Columns in Excel (6 Easy Ways)