EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Certification Courses
  • 120+ Courses All in One Bundle
  • Login
Home Excel Excel Resources Lookup & Reference Functions in Excel Excel COLUMNS Function
Secondary Sidebar
Excel Functions
  • Lookup and Reference Functions in Excel
    • VLOOKUP Function in EXCEL
    • VLOOKUP True
    • VLOOKUP Error
    • How to Match Data in Excel
    • Excel Match Function
    • Excel Lookup Function
    • ROWS Function in Excel
    • Excel INDEX Function
    • VLOOKUP Table Array
    • Excel OFFSET Formula
    • VLOOKUP For Text
    • IF VLOOKUP Formula in Excel
    • Mixed Reference in Excel
    • CHOOSE Formula in Excel
    • Excel COLUMN to Number
    • Excel Alternatives to VLOOKUP
    • HLOOKUP Examples
    • Excel VLOOKUP From Another Sheet
    • VLOOKUP with Sum
    • Fixing VLOOKUP Errors
    • Compare Two Columns in Excel using VLOOKUP
    • Excel ROW Function
    • HYPERLINK in Excel
    • Address Excel Function
    • Excel COLUMNS Function
    • Excel REPLACE Function
    • OFFSET Excel Function
    • Excel GETPIVOTDATA Function
    • MATCH Function in Excel
    • VLOOKUP Function in Excel
    • HLOOKUP Function in Excel
    • LOOKUP in Excel
    • CHOOSE Function in Excel
    • TRANSPOSE in Excel
    • COLUMN Function in Excel
    • INDIRECT Function in Excel
  • Excel Functions (12+)
  • Excel Tools (114+)
  • Financial Functions in Excel (17+)
  • Logical Functions in Excel (14+)
  • Maths Function in Excel (47+)
  • TEXT and String Functions in Excel (26+)
  • Date and Time Function in Excel (24+)
  • Statistical Functions in Excel (59+)
  • Information Functions in Excel (4+)
  • Excel Charts (56+)
  • Excel Tips (220+)
  • Workplace Productivity (4+)
  • Microsoft Office Tools (15+)
  • Excel Formula and Functions (22+)
  • MS Excel Shortcuts (4+)
Excel Functions Courses
  • Online EXCEL COURSE
  • Online EXCEL ADVANCED Training

Excel COLUMNS Function

By Pradeep SPradeep S

COLUMNS Function in Excel

COLUMNS in Excel (Table of Contents)

  • COLUMNS in Excel
  • How to Use COLUMNS Function in Excel?

COLUMNS in Excel

The columns function in excel is another easiest function to apply, which simply counts the number of columns that are selected. It returns the count of the number of columns selected in the array. For this, we just have to select the complete columns or columns in the form of a table or matrix. It will simply return the count of columns there in an array.

Start Your Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

COLUMNS Formula in Excel:

The Formula for the COLUMNS Function in Excel is as follows:

COLUMNS Formula in Excel

The COLUMNS Function formula has a below-mentioned argument:

Array: reference to an array OR range of cells for which we have to calculate a number of columns.

Note:

  • If the range of cells or array contains multiple rows and columns, only the columns are counted.
  • COLUMNS Function in Excel will always return a positive numeric value.

How to Use COLUMNS Function in Excel?

This COLUMNS Function is very simple easy to use. Let us now see how to use the COLUMNS Function in Excel with the help of some examples.

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

Example #1

In the below-mentioned example, I have a dataset in a range, i.e. B7:G13, where it contains the company & its share value on a daily basis. Here I need to find out the number of columns in that range with the help of the COLUMNS Function.

Example 1

Let’s apply the COLUMNS function in cell “I8”.

COLUMNS Example 1-1

Select the cell “I8” where the COLUMNS function needs to be applied, Click the insert function button (fx) under the formula toolbar, a dialog box will appear, type the keyword “COLUMNS” in the search for a function box, COLUMNS function will appear in select a function box.

COLUMNS Example 1-2

Double click on COLUMNS function, a dialog box appears where arguments for COLUMN function needs to be filled or entered, i.e. =COLUMNS (array)

Array: Reference to an array OR range of cells for which we have to calculate a number of columns, i.e. Here it is B7:G13, where Here, B7 is a starting cell and G13 is the ending cell in a table or range.

COLUMNS Example 1-3

Click ok after entering the arguments in the COLUMNS function. i.e.=COLUMNS (B7:G13) COLUMNS function calculates the total number of columns present in a range, i.e. 6. The number of columns in between these two cells (B7 & G13) is 6; hence it results in 6.

COLUMNS Example 1-4

Example #2

In the below-mentioned example, I have a dataset in a range, i.e. B18:G24, where it contains the company & its share value on a daily basis. Here I need to find out the Total cell in range with the help of the COLUMNS function.

Example 2

Let’s apply the COLUMNS function in cell “I19”.

COLUMNS Example 2-1

Select the cell “I19” where the COLUMNS function needs to be applied, Click the insert function button (fx) under the formula toolbar, a dialog box will appear, type the keyword “COLUMNS” in the search for a function box, COLUMNS function will appear in select a function box.

COLUMNS Example 2-3

Double click on COLUMNS function, A dialog box appears where arguments for COLUMN function needs to be filled or entered i.e.

=COLUMNS (array)

Array: reference to an array OR range of cells for which we have to calculate a number of columns, i.e. Here it is B18:G24 where Here, B18 is a starting cell and G24 is the ending cell in a table or range.

COLUMNS Example 2-4

Multiplication needs to be performed between the total number of columns and a total number of rows for the given array or range of cells to get the total number of cells in an array or table.

i.e. =COLUMNS(B18:G24)*ROWS(B18:G24)

COLUMNS Example 2-5

Here, the total number of rows is 7 & the total number of columns is 6. So, the total number of cells is 7*6 = 42

COLUMNS Example 2-6

Example #3

The COLUMNS function is important when using functions where a column argument is required, e.g. VLOOKUP in case of a huge number of datasets; it is not easy to manually count the number of columns in a table array.

During these scenarios, In the VLOOKUP function, The COLUMNS function is used to return the col_index_num argument value.

Let check out the difference between the Vlookup function with & without Columns Function.

In the below-mentioned example, table2 contains the company in column B & its share value on a daily basis ( 6th, 7th,8th, 9th & 10thNov 2018) in columns C, D, E, F & G, respectively.

Example 3

Table 3 contains the company name in column B; our objective here in this table is to find out its share value on 6th Nov 2018 in column C, with the help of table 2 reference by using the VLOOKUP function.

COLUMNS Example 3-1

Prior to applying the VLOOKUP formula, you should be aware of it. Vertical lookup or VLOOKUP references vertically aligned tables and quickly finds data in relation to the value the user enters.

VLOOKUP Function without COLUMNs Function

Let’s apply the VLOOKUP function in cell “C29”.

COLUMNS Example 3-2

Select the cell “C29”. where the VLOOKUP function needs to be applied; click the insert function button (fx) under the formula toolbar, a dialog box will appear, type the keyword “VLOOKUP” in the search for a function box, VLOOKUP function will appear in select a function box.

COLUMNS Example 3-3

Double click on the VLOOKUP function, A dialog box appears where arguments for the VLOOKUP function need to be filled or entered.

The Formula for the VLOOKUP function is:

VLOOKUP (lookup_value, table_array, col_index_num, [range_lookup])

  • lookup_value: The value you want to look up, i.e. “B29” or “MEDICO.”
  • table_array: Range where the lookup value is located, i.e. select table 2 range B18:G24 & click function f4 key to lock a range, i.e. $B$18:$G$24.
  • col_index_num: column number in a table array from which the matching value should be returned. Here the company share value on 6th November 2018 is in table 2 & it is in the second column, i.e. 2
  • range_lookup: FALSE for an exact match or TRUE for an approximate match. Select 0 or false.

COLUMNS Example 3-4

=VLOOKUP(B29,$B$18:$G$24,2,0) returns the share value of Medco on 6th November 2018, i.e. 69

COLUMNS Example 3-5

To get the finalized data for other company share prices, click inside cell C29 and you’ll see the cell selected, then Select the cells till C31. So that column range will get selected, once it got selected, click on Ctrl + D so that the VLOOKUP formula is applied to a whole range.

COLUMNS Example 3-6

VLOOKUP Function with COLUMNS Function

Above the table 2 column header, B17 to G17 is the column number that needs to be mentioned prior to applying Vlookup with the columns function.

Example 3-7

Table 4 contains the company name in column G; our objective here in this table is to find out its share value on 8th Nov 2018 in column H, with the help of table 2 reference by using VLOOK with COLUMNS function.

COLUMNS Example 3-8

In VLOOKUP Function without COLUMNS Function, Formula was:

=VLOOKUP(C29,$B$18:$G$24,2,0)

Where 2 was the column index number, here let’s replace this with the COLUMNS($B$17:$E$17) function in the Vlookup function in cell H29 of table 4. Here we need a share price value for 8th Nov 18, hence the select column reference B17 to E17 in columns function of the table.

i.e. =VLOOKUP(G29,$B$18:$G$24,COLUMNS($B$17:$E$17),0)

With VLOOKUP Example 3-9

=VLOOKUP(G29,$B$18:$G$24, COLUMNS($B$17:$E$17),0) returns the share value of Medco on 8th November 2018, i.e. 68

With VLOOKUP Example 3-10

To get the finalized data for other company share prices, click inside cell H29 and you’ll see the cell selected, then Select the cells till H31. So that column range will get selected, once it is selected, press Ctrl + D so that the formula is applied to a whole range.

With VLOOKUP Example 3-11

Here simultaneously, we have to change the column reference in column function & lookup value based on the data requirement.

Things to Remember

  • The COLUMNS Function in Excel is important or significant when using functions where a column argument is required (e.g. VLOOKUP); in the case of a huge number of datasets, it is not an easy task to manually count the number of columns in a table array (Explained in example 3).
  • The array argument in the COLUMNS Function can be either a range of cells or single-cell addresses.
  • If the range of cells or array contains multiple rows and columns, only the columns are counted.
  • COLUMNS function in Excel will always return a positive numeric value.

Recommended Articles

This has been a guide to COLUMNS in Excel. Here we discuss the COLUMNS Formula in Excel and how to use COLUMNS Function in Excel along with excel examples and downloadable excel templates. You may also look at these useful functions in excel –

  1. Freeze Columns in Excel
  2. Column Header in Excel
  3. COLUMNS Formula in Excel
  4. VBA Columns
Popular Course in this category
Excel Training (23 Courses, 9+ Projects)
  23 Online Courses |  9 Hands-on Projects |  110+ Hours |  Verifiable Certificate of Completion
4.9
Price

View Course

Related Courses

Excel Advanced Training (16 Courses, 23+ Projects)4.9
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Excel Charts
  • Excel Tips
  • All Tutorials
Certification Courses
  • All Courses
  • Excel VBA Course - All in One Bundle
  • VBA Course
  • Excel Data Analysis Course
  • Excel for Marketing Course
  • Excel for Finance Course
  • Excel for HR Training

ISO 10004:2018 & ISO 9001:2015 Certified

© 2023 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

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

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

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

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

Download COLUMNS Function Excel Template

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

Download COLUMNS Function Excel Template

EDUCBA

डाउनलोड COLUMNS Function Excel Template

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

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more