Yesterday we had the COLUMN function, and today we have the COLUMNS function. COLUMNS takes a range and returns the number of columns there are in that range. It looks like this:-

**=COLUMNS(range)**

It’s really that simple. Use a range (either a reference or named) as the criteria and COLUMNS will return the number of columns:-

**=COLUMNS(A1:C3)
=3**

And, just so you get it, here’s another:-

**=COLUMNS(M10:Q10)
=5**

Got it? Good. COLUMNS can also be used to count the number of columns in an array of values. Obviously these aren’t columns like those found in cells, but the function returns the same. If, for example you typed:-

**=COLUMNS({1,2,3,4;1,2,3,4})**

You have asked the COLUMNS function to count how many ‘columns’ of data there are in the array (defined within the curly brackets). In the example above, the comma symbols separate the columns and the semicolon the ‘rows’ of the array. Pressing the enter key will return a value of 4, as you’d expect. I’ll post about arrays at a future time, so you don’t have to worry too much about them for now if what I’ve just said doesn’t make sense.