When you want to count the number of columns in a range, you can use the COLUMNS function and select a proper range (Fig. 1)
=COLUMNS(B13:E17)

The function will return the number of columns in this range (Fig. 2)

You can also create a horizontal sequence of numbers. You just have to write the COLUMNS function and create a proper range, let’s say B13 to B13. In this case, it is important to lock one of the cells with a $ sign by pressing the F4 key so that it doesn’t move (Fig. 3)
=COLUMNS($B$13:B13)

After entering the formula and copying to the right, we can see that our range expands, i.e. one cell stays the same, and the other one is moving to the right (Fig. 4).
