When you want to count the num­ber of columns in a range, you can use the COLUMNS func­tion and select a prop­er range (Fig. 1)

COLUMNS func­tion — how many columns in a range

=COLUMNS(B13:E17)

Fig. 1 COLUMNS function

The func­tion will return the num­ber of columns in this range (Fig. 2)

Number of columns
Fig. 2 Num­ber of columns

You can also cre­ate a hor­i­zon­tal sequence of num­bers. You just have to write the COLUMNS func­tion and cre­ate a prop­er range, let’s say B13 to B13. In this case, it is impor­tant to lock one of the cells with a $ sign by press­ing the F4 key so that it does­n’t move (Fig. 3)

=COLUMNS($B$13:B13)

COLUMNS function with a range
Fig. 3 COLUMNS func­tion with a range

After enter­ing the for­mu­la and copy­ing to the right, we can see that our range expands, i.e. one cell stays the same, and the oth­er one is mov­ing to the right (Fig. 4).

Formula changes
Fig. 4 For­mu­la changes

https://www.youtube.com/shorts/mQRaB86awNQ