MS Excel: Columns Function
In Excel, the Columns function returns the number of columns in a cell reference.
The syntax for the Columns function is:
Columns( reference )
reference is a reference to a range of cells or an array.
Applies To:
- Excel 2007, Excel 2003, Excel XP, Excel 2000
For Example:
Let's take a look at an example:
=Columns(B4) would return 1 =Columns(A4:B6) would return 2 =Columns({1,2;3,4}) would return 2 =Columns({1,2,3,4;5,6,7,8}) would return 4
You can also defined a named range called suppliers that refers to Sheet1!$A$1:$C$8.

Then using the Columns function, you could refer to this named range as follows:
=Columns(suppliers) would return 3