tech on the net
Home About Us Feedback Site Map


Access Excel Word


SQL Oracle / PLSQL SQL Server MySQL MariaDB PostgreSQL

Web Development

HTML CSS Color Picker


C Language


ASCII Table Linux UNIX Java Clipart Joke of the Moment

Excel Functions

(Scroll to see more)

Share this page:

MS Excel: COLUMNS Function (WS)

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


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


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) 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.

Microsoft Excel

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

=COLUMNS(suppliers) would return 3