First weekday should be Monday

WEEKDAY() begins counting from Sunday. i.e., Sunday=1, Saturday=7

My current expression [DATE]+7-WEEKDAY([DATE]) gets the weekending date of [DATE]

I need an expression that gets the weekending date with the first day of the week being Monday and the last being Sunday, Monday=1, Sunday=7

Any ideas would be appreciated.

Solved Solved
0 6 1,678
1 ACCEPTED SOLUTION

Thank you Phil & Steve

@Steve: The expression is the same as Philโ€™s isnโ€™t it? Phil just wrote the fields differently [DayOfDate] and you didnโ€™t [DATE].

View solution in original post

6 REPLIES 6

See the last paragraph in topic โ€œFunctionโ€ in this article https://help.appsheet.com/expressions/expression-types/date-and-time-expressions

It says:

The value returned by WEEKNUM() assumes the week starts on Sunday and ends on Saturday. To get the week number when the week starts on Monday and ends on Sunday, use the following expression:

IF(AND(MONTH([Date]) = 1, Day([Date]) = 1), 1, WEEKNUM([Date] - 1))

This is great and I thank you but, how do I now convert the returned week number to the week ending date? I really am not interested in the week number I just need the week ending date. It would be great if the appsheet weekday expression functioned like the google sheet and gave us typesโ€ฆ

Sorry, I misread your post. Try:

[DateOfDay]+7-WEEKDAY([DateOfDay]-1)

Thank you Phil & Steve

@Steve: The expression is the same as Philโ€™s isnโ€™t it? Phil just wrote the fields differently [DayOfDate] and you didnโ€™t [DATE].

Steve
Platinum 4
Platinum 4

Would this not work?

[DATE]+7-WEEKDAY([DATE])-1

Yes, I wrote a simple test app and called my field [DateOfDay].
I wanted to try all of the edge cases. Steveโ€™s formula is better because it uses your field name.

Top Labels in this Space