Google-sheets – Increase 1 increment every x rows on Google Sheets

google sheets

Basically, I just want to automatically increase the week number (on column A), and have it correspond with every new Monday (in Column B). I have been trying to click and drag, hoping it would somehow automatically adjust the increment every 7 rows but it doesn't seem to work.

How would I be able to do this without having to manually increase the number every Monday?

Best Answer

Formula

=ArrayFormula(IF(WEEKDAY(FILTER(C:C,C:C>0),2)=1,WEEKNUM(C:C,1),))

Explanation

WEEKNUM(C:C,1) returns the number of the week for all the values column C. To to fill only the cells that corresponds to mondays and that row is not empty, it was included as the TRUE result of an IF function with the following test:

WEEKDAY(FILTER(C:C,C:C>0),2)=1

ArrayFormula makes that the results be expanded to the required rows.