DAYOFWEEK
Formula Explanation
Returns the day of the week index for a date, where Monday is 1 and Sunday is 7.
Formula Syntax
Enter in the result column: dayofweek(date / data column, [returnType])
date / data column: Represents the input of the date, which can be a specific date value or a data column containing date values.
returnType: Used to specify the type of return value, with three options, default is 2.
1: Returns 1 to 7 (Sunday to Saturday).
2: Returns 1 to 7 (Monday to Sunday).
3: Returns 0 to 6 (Monday to Sunday).
Usage Example
- Calculate the day of the week corresponding to the dates in column CM2, and write the results into column CM3.
CL3 = dayofweek("CL2")
September 2, 2023, is a Saturday
- returnType=1,value = 7
CL3 = dayofweek("CL2,1")
- returnType=3,value = 5
CL3 = dayofweek("CL2,3")