When you work with a large dataset, you may wonder how many columns are in a range. This is relatively easy and we can use the COLUMNS function to figure it out. However, if you want to check which column a number or a text string is in a range, you will need the COLUMN function.
In summary, the COLUMNS function tells you how many columns a range has, while the COLUMN function tells which column a value is in.
Example: You are working with a dataset with the product in column A, the DOB in column B, and the amount sold in column C.
Formula 1: To count how many columns the range of A1:C12 has
=COLUMNS(A1:C12)
The result returns 3, and the range has 3 columns.
Formula 2: To figure which column a number is in, e.g., 529,944
= COLUMN(C5)
Type the formula in a cell and find the number in column C (C5). The result returns 3, and the number is in column 3.
Notes: The COLUMNS function
Formula:
= COLUMNS(array)
Explanations:
The array is required. The number of columns in the data ranges you are looking for.