Summary

To count columns in an Excel table, you can use the COLUMNS function. In the example shown, the formula in I4 is:

=COLUMNS(Table1)

The result is 5, the number of columns in Table1 as shown.

Generic formula

COLUMNS(table)

Explanation

This formula uses structured referencing, a syntax that allows table parts to be referred to by name. When a table is referred to by the name only, Excel returns a reference to the data region of the table only. In this case, the entire table range is B4:F104 so Table1 returns the range B5:F104 to the COLUMNS function.

=COLUMNS(Table1)
=COLUMNS(B5:F104)

COLUMNS then returns a final result of 5, since there are 5 columns in the table.

Support Exceljet

Many websites (including Exceljet) have lost over half their traffic in the past year because of the crushing impact of AI on web searches. Exceljet is still at it, publishing free content each week. If you find Exceljet helpful, you can support the site and go ad-free with the Exceljet Lifetime Pass. One payment, no subscription, and ads are gone forever. Plus, you get our Excel Shortcuts video course as a thank you.

Get the Lifetime Pass

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

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.