Examples
Use the COLUMNS function to get the column count for a given reference or range. For example, there are 6 columns in the range A1:F1 so the formula below returns 6: The range A1:Z100 contains 26 columns, so the formula below returns 100: You can also use the COLUMNS function to get a column count for an array constant: Although there is no built-in function to count the number of cells in a range, you can use the COLUMNS function together with the ROWS function like this: More details here.
Notes
Array can be a range or a reference to a single contiguous group of cells. Array can be an array constant or an array created by another formula. To count rows, see the ROW function. To get column numbers, see the COLUMN function. To lookup a column number, see the MATCH function.
Dave Bruns
Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.