Search code examples
google-sheetssplitgoogle-sheets-formulavlookupweek-number

How to reset Week Number when the Year changes in Google Sheets


I use the following formula to determine the week number for a given period. Is it possible to reset the week number when the year changes?

=INDEX(IFNA(TEXT(VLOOKUP(A2:A, {UNIQUE(FILTER(A2:A, A2:A<>" ")),SEQUENCE(COUNTUNIQUE(A2:A))}, 2, 0), "0")))

enter image description here


Solution

  • try:

    =INDEX(WEEKNUM(INDEX(SPLIT(A2:A3, " - ", ),,1)))
    

    enter image description here