Share this page:

MS Excel: COLUMNS Function (WS)

Learn how to use the Excel COLUMNS function with syntax and examples.

Description

The Microsoft Excel COLUMNS function returns the number of columns in a cell reference.

Syntax

The syntax for the Microsoft Excel COLUMNS function is:

COLUMNS( reference )

Parameters or Arguments

reference is a reference to a range of cells or an array.

Applies To

The COLUMNS function can be used in the following versions of Microsoft Excel:

  • Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000

Type of Excel Function

The COLUMNS function can be used in Microsoft Excel as the following type of function:

  • Worksheet function (WS)

Example (as Worksheet Function)

Let's look at some Excel COLUMNS function examples and explore how to use the COLUMNS function as a worksheet function in Microsoft Excel:

=COLUMNS(B4)
Result: 1

=COLUMNS(A4:B6)
Result: 2

=COLUMNS({1,2;3,4})
Result: 2

=COLUMNS({1,2,3,4;5,6,7,8})
Result: 4

You can also defined a named range called suppliers that refers to Sheet1!$A$1:$C$8.

Microsoft Excel

Then using the COLUMNS function, you could refer to this named range as follows:

=COLUMNS(suppliers)
Result: 3