Return to List of Excel Functions

# COLUMNS Function Examples – Excel, VBA, & Google Sheets

Download the example workbook

In this Article

*This Tutorial demonstrates how to use the Excel COLUMNS Function in Excel to count the number of columns.*

## COLUMNS Function Overview

The COLUMNS Function Calculates the number of columns in an array.

To use the COLUMNS Excel Worksheet Function, select a cell and type:

(Notice how the formula inputs appear)

## COLUMNS function Syntax and inputs:

1 |
=COLUMNS(array) |

**array** – Count the number of columns in this array.

**COLUMNS Function **

The COLUMNS Function returns the number of columns in a given cell reference.

1 |
=COLUMNS(T4) |

**COLUMNS Function – Cell Range**

You can also enter a cell range and it will return the total number of columns in it.

1 |
=COLUMNS(R3:U7) |

**COLUMNS Function – Array Constant**

You can also count the number of columns in a given array constant.

1 |
=COLUMNS({1,2,3,4,5,6,7,8,9}) |

**COLUMNS** Function in Google Sheets

The COLUMNS Function works exactly the same in Google Sheets as in Excel:

## Additional Notes

Use the COLUMNS Function to count the number of columns in a range of cells.

To count the number of rows, use the ROWS Function.

Return to the List of all Functions in Excel