Description
Use this function to determine the day of the week for that a date will fall on. Supported in Chains.
This returns an integer between 1 and 7 inclusive.
Syntax
WEEKDAY(serial_number,[return_type])
Inputs
This function has the following arguments:
| Name | Required | Valid input |
|---|---|---|
serial_number |
Yes | A sequential number that represents the date of the day you are trying to find. Dates should be entered by using the DATE function, or as results of other formulas or functions. For example, use DATE(2024,6,23) for the 23rd day of May, 2008. Problems can occur if dates are entered as text. |
return_type |
No | An integer that determines the type of return value. This can be a fixed number, a cell reference, or the product of a formula. |
Example
Return type
The WEEKDAY function allows you to specify what coding is to be used to determine the returned value.
| Return_type value | Number returned |
|---|---|
| 1 (default) | 1 = Sunday through 7 = Saturday. Behaves like previous versions of Microsoft Excel. |
| 2 | 1 = Monday through 7 = Sunday. |
| 3 | 0 = Monday through 6 = Sunday. |
| 11 | 1 = Monday through 7 = Sunday. |
| 12 | 1 = Tuesday through 7 = Monday. |
| 13 | 1 = Wednesday through 7 = Tuesday. |
| 14 | 1 = Thursday through 7 = Wednesday. |
| 15 | 1 = Friday through 7 = Thursday. |
| 16 | 1 = Saturday through 7 = Friday. |
| 17 | 1 = Sunday through 7 =Saturday. |
The second way to configure weekends is to provide a 7 character text string enclosed in quotation marks composed of 1s and 0s, where "1" indicates a non-work day and "0" indicates a work day. The first position represents Monday.
Sample data
| A | B | C | |
|---|---|---|---|
| 1 | Date | Person | Expenses |
| 2 | 2/1/2023 | Abby | $3456.00 |
| 3 | 5/12/2023 | Brandon | $4783.30 |
| 4 | 7/4/2023 | Corinna | $3167.09 |
| 5 | 2/21/2023 | Damon | $2965.89 |
| 6 | 12/5/2023 | Esther | $3014.88 |
| 7 | 6/16/2023 | Francoise | $2762.93 |
Sample formulas
| Use case | Formula | Explanation and Result |
|---|---|---|
| Return the month value for a date in a cell. | =MONTH(A1) |
This formula returns the month number for the date in cell A1. For this data set, the formula returns 2. |
| Return the month value for an explicit date. | =MONTH("17/9/2003") |
Returns the month number for the supplied date of 17/9/2003 . This formula returns 9. |
| Categorize expenses by month. | =SUM(IF(MONTH(A2:A8)=2, C2:C8, 0)) |
This formula works in the following manner:
For this data set, the formula returns: 6421.89 (the sum of rows 2 and 5). |
| Check if a date falls within a specific month. | =IF(MONTH(A7)=12, "December", "Other") |
This formula works in the following manner: IF checks to see if the date in cell A7 falls in December For this data set, the formula returns: Other (because the month is 7 - July). |
Notes
- The WEEKDAY function will return a value even when the date is empty. Take care to trap this result if blank dates are possible.
- The Workiva platform stores dates as sequential serial numbers so they can be used in calculations. By default, January 1, 1900 = 1.
- If
serial_numberis out of range, a #NUM! error is returned. - If the
return_typevalue isn't in the set specified above, a #NUM! error is returned. - Wildcards don't work with this function.
Related functions
DATE
DATEVALUE
DAY
DAYS
DAYS360
EDATE
EOMONTH
MONTH
NETWORKDAYS
NETWORKDAYS.INTL
WEEKDAY
WORKDAY
WORKDAY.INTL
YEAR
YEARFRAC