We use COLUMNS function to count the number of columns in a table in both Excel & Google Sheet.
- Table : We need to provide the table as an argument for which the number of columns need to be counted
In below example we have used COLUMNS function in cell H6 to count the number of columns in table C5:F12
- You might be thinking that getting the number of columns in a table is easy. Without using the COLUMNS function it can be done by just selecting the first cell to last cell of a single row of the table and number of columns will be displayed in the status bar. But remember, that feature won’t consider the blank cells. That will actually count the number of non-blank cells only.
- But using COLUMNS function, the actual number of columns in the specified table can be retrieved even if there is one or all blank cells present in any column(as in our example).
- The COLUMNS function can be useful in the scenario where the table doesn’t start from the first column of the excel (as in our example) and we need to get the number of columns as part of any formula with the table.