I. Intro
You can use the WEEKNUM function to find the week of the year on which a specified date falls.
II. About the function
- Formula: =WEEKNUM(date, [type])
- Parameters:
- Date (required): The date that you want to find the week number for. It must be one of the following: a reference to a cell containing a date, a function returning a value in a date format, or an integer.
- Type (optional): A number indicating which day the week starts on. Sunday is 1.
- Example:
- In a cell, enter =WEEKNUM("2021-1-31", 2).
- The formula will calculate which week of 2021 Jan 31, 2021 falls in, if Monday is considered as the first day of the week.
- The cell will return the value 5, indicating that Jan 31, 2021 is in the 5th week of 2021.
- Note: Use double quotation marks (") around the date in the formula.
III. Steps
You can use the WEEKNUM function together with TODAY and NOW functions to create a mini calendar in a sheet.
- Use the TODAY and NOW functions to obtain the current date and time.
- In a blank cell, enter =WEEKNUM(today's date) to obtain the current week of the year. In the image below, =WEEKNUM(B33) returns week number 20 for May 12.
- The WEEKNUM, TODAY, and NOW functions will be updated every time you refresh the sheet.
250px|700px|reset