WallStreetMojo

WallStreetMojo

WallStreetMojo

MENUMENU
  • Free Tutorials
  • Certification Courses
  • Excel VBA All in One Bundle
  • Login
Home » Excel, VBA & Power BI » Excel Tutorials » Columns Function in Excel

Columns Function in Excel

COLUMNS Function in Excel

COLUMNS function is a built-in function in Microsoft Excel. It falls under the category of Lookup Functions in Excel. COLUMNS Function returns the total number of columns in the given array or collection of references. The purpose of the COLUMNS formula in Excel is to know the number of columns in an array of references.

Syntax

Columns formula in excel 

COLUMNS Function has only one argument. Where,

  • array = This is a required parameter. An array / a formula resulting in an array / a reference to a range of excel cells for which the number of columns is to be calculated.

How to use COLUMNS Formula in Excel?

You can download this COLUMNS Function Excel Template here – COLUMNS Function Excel Template

The said function is a Worksheet (WS) function. As a WS function, Columns can be entered as a part of the formula in a cell of a worksheet. Refer to the examples given below to understand better.

Let’s look at the columns examples given below. Each example covers a different use case implemented using the COLUMNS function.

Example 1 – Total columns in a range

Columns Function Example 1

In the example of this column, cell G3 has a formula associated with it. So, G3 is a result cell. The argument for COLUMNS Function in excel is a cell range, which is B4:D4. Here, B4 is a starting cell, and D4 is the ending cell. The number of columns in between these two cells is 3. So, the result is 3.

Example 2 – Total cells in a range

Example 2

In this example, cell G4 has a formula associated with it. So, G4 is a result cell. The formula is COLUMNS (B4: E8) * ROWS*B4: E8). Multiplication is performed between the total number of columns and a total number of rows for the given range of cells in the sheet. Here, the total number of columns is four, and the total number of rows is 5. So, the total number of cells is 4*5 = 20.

Example 3 – Get the address of the first cell in a range

Example 3

Here, the dataset is named as ‘data.’ Further, this ‘data’ is used in the formula. Refer to the steps given below to name the dataset.

Popular Course in this category
Sale
All in One Excel VBA Bundle (35 Courses with Projects)
4.9 (1,353 ratings)
35+ Courses | 120+ Hours | Full Lifetime Access | Certificate of Completion
View Course
  • Step#1. Select the cells.
  • Step#2. Right and click and choose ‘Define Name.’
  • Step#3. Name the dataset as ‘data.’

Example 3-1

In the example of these columns, cell G6 has a formula associated with it. So, G6 is a result cell. The formula is to calculate the first cell in the dataset represented by the name ‘data.’ The result is $B$4 i.e., B4, which is the last cell in the selected dataset.

The formula uses the ADDRESSES function, which has two parameters, namely row number, and column number.

E.g., ADDRESS (8,5) returns $B$4. Here, 4 is the row number, and 2 is the column number. So, the function returns cell denotes by these row and column numbers.

Here,

A row number is calculated by

ROW(data)

And the column number is calculated by

COLUMN(data)

Example 4 – Get the address of the last cell in a range

Example 4

Here, the dataset is named as ‘data.’ Further, this ‘data’ is used in the column’s formula in excel. Refer to the steps given below to name the dataset.

  • Step#1. Select the cells.
  • Step#2. Right and click and choose ‘Define Name.’
  • Step#3. Name the dataset as ‘data.’

Example 4-1

In this COLUMNS example, cell G5 has a formula associated with it. So, G5 is a result cell. The formula is to calculate the last cell in the dataset represented by the name ‘data.’ The result is $E$8 i.e., E8, which is the last cell in the selected dataset.

The formula uses the ADDRESSES function, which has two parameters, namely row number, and column number.

E.g., ADDRESS (8,5) returns $E$8. Here, 8 is the row number, and 5 is the column number. So, the function returns cell denotes by these row and column numbers.

Here,

A row number is calculated by

ROW(data)+ROWS(data-1)

And the column number is calculated by

COLUMN(data)+COLUMNS(data-1)

Things to Remember

  • The argument of the COLUMNS function in excel can be a single cell address or a range of cells.
  • The argument of the COLUMNS function cannot point to multiple references or cell addresses.

Columns Function in Excel Video

Recommended Articles

This has been a guide to Columns Function in Excel. Here we discuss how to use the Columns function along with practical examples and downloadable excel templates. You can also go through our other suggested articles –

  • Excel Column Lock
  • Excel Freeze Columns
  • Group Column in Excel
  • Column in Excel
  • Break Links in Excel
4 Shares
Share
Tweet
Share
All in One Excel VBA Bundle (35 Courses with Projects)
  • 35+ Courses
  • 120+ Hours
  • Full Lifetime Access
  • Certificate of Completion
LEARN MORE >>
Primary Sidebar
Footer
COMPANY
About
Reviews
Contact
Privacy
Terms of Service
RESOURCES
Blog
Free Courses
Free Tutorials
Investment Banking Tutorials
Financial Modeling Tutorials
Excel Tutorials
Accounting Tutorials
Financial Statement Analysis
COURSES
All Courses
Financial Analyst All in One Course
Investment Banking Course
Financial Modeling Course
Private Equity Course
Venture Capital Course
Excel All in One Course

Copyright © 2021. CFA Institute Does Not Endorse, Promote, Or Warrant The Accuracy Or Quality Of WallStreetMojo. CFA® And Chartered Financial Analyst® Are Registered Trademarks Owned By CFA Institute.
Return to top

WallStreetMojo

Free Excel Course

Excel functions, Formula, Charts, Formatting creating excel dashboard & others

* Please provide your correct email id. Login details for this Free course will be emailed to you

Book Your One Instructor : One Learner Free Class
Let’s Get Started
Please select the batch
Saturday - Sunday 9 am IST to 5 pm IST
Saturday - Sunday 9 am IST to 5 pm IST

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

WallStreetMojo

Free Excel Course

Excel functions, Formula, Charts, Formatting creating excel dashboard & others

* Please provide your correct email id. Login details for this Free course will be emailed to you

Login

Forgot Password?

WallStreetMojo

Download COLUMNS Function Excel Template

New Year Offer - All in One Excel VBA Bundle (35 Courses with Projects) View More