Google Sheets | WEEKDAY | WEEKNUM | Function | How to Use | Spreadsheet Tutorial | Example
Ideas No Comments »The Google Sheets WEEKDAY and WEEKNUM functions return the day of the week and week number of the year respectively. Each of these functions have the same type and number of attributes.
WEEKDAY Function
The weekday function returns the day of the week of the specified date as a number. Its value ranges from 0 to 7, depending on the value specified for the type attribute.
Here is the format of the WEEKDAY function formula:
=WEEKDAY(date, [type])
Start the formula with an equal-to symbol.
date is the date for which to get the day of the week. Date, for example, can be a hard-coded date, an address of a cell containing a date, or a function that returns a date.
type is optional, and is a number indicating the numbering system to be used to represent the days of the week.
The default value is 1. It indicates that days are counted starting from Sunday. Its value is 1. Monday’s value is 2, Tuesday’s value is 3, and so on.
If type equals 2, the days are counted starting from Monday. Its value is 1, Tuesday’s value is 2, and Sunday’s value is 7.
If type equals 3, the days are counted starting from Monday. Its value is 0. Monday’s value is 1, and Sunday’s value is 6.
Let’s look at an example of the WEEKDAY function formula:
=WEEKDAY(“9/1/2021”, 1)
The above function formula returns 4. It means the day, which is 1, is the
fourth day of the week.
WEEKNUM Function
The WEEKNUM function returns the number of the week of the year of the specified date.
Here is the format of the WEEKNUM function formula:
=WEEKNUM(date, [type])
date is the date for which to get its week of the year.
type is optional. Its value can be any one of 1, 2, 11, 12, 13, 14, 15, 16, 17, or 21. These numbers define the start and end day of a week for counting
week numbers. If this attribute is omitted, the function uses 1 as the default value.
System 1 and System 2
The two numbering systems the WEEKNUM function indirectly uses are either System 1 or System 2. In System 1, the first week of the year is the one which contains January 1 and is represented as week 1.
In System 2, the first week of the year is the one which contains the first Thursday of the year and is represented as week 1.
The definition of a value of the type attribute is:
1 = Week begins on Sunday, ends on Saturday.
2 = Week begins on Monday, ends on Sunday.
11 = Week begins on Monday, ends on Sunday.
12 = Week begins on Tuesday, ends on Monday.
13 = Week begins on Wednesday, ends on Tuesday.
14 = Week begins on Thursday, ends on Wednesday.
15 = Week begins on Friday, ends on Thursday.
16 = Week begins on Saturday, ends on Friday.
17 = Week begins on Sunday, ends on Saturday.
In System 2 only:
21 = Week begins on Monday, ends on Sunday.
Let’s look at an example:
=WEEKNUM(“9/1/2021”, 1)
The above function formula returns 36 as the number of the week, of the year, to which the specified date belongs.
Take a look at this video tutorial, which gives the steps to use the Google Sheets WEEKDAY and WEEKNUM functions with examples.
This video demonstrates how to use Excel’s WEEKNUM and ISOWEEKNUM functions to convert a date into its week number.
————————
Video Rating: / 5