COLUMNS


Returns the number of columns in a given reference.

Syntax:

COLUMNS(reference)

reference may be given explicitly (eg A3:B5)

Example:

COLUMNS(A3:B5)

returns 2; there are two columns in this range, namely columns A and B.

COLUMNS(G4:H4)

returns 2; there are two columns in this range, namely columns G and H.

COLUMNS(D8)

returns 1; D8 is interpreted as a one cell range, with a single column (column D).



Application:

Let's imagine you're a teacher using a spreadsheet to keep track of your students' grades. You have a table set up like this:

Student Name

Math Grade

Science Grade

History Grade

A
B
C
D
1
Alice
92
88
95
2
Bob
78
85
82
3
Carol
95
91
93

You want to quickly know how many subjects you are tracking for each student. You could use the COLUMNS function.

In your spreadsheet, you could write the formula COLUMNS(B1:D3).


The COLUMNS function looks at the range of cells you've provided, which in this case is B1:D3. This range includes the columns for "Math Grade," "Science Grade," and "History Grade." The function then returns the number of columns in that range, which is 3.

This tells you that you are tracking grades for three different subjects for your students.

Result:

3




This page is protected by Google reCAPTCHA. Privacy - Terms.
 
Built using Zapof