Sharepoint - How to set the Default value of a Date/Time column to next Friday?

In the Default option you can use [Today] plus some number of days... you would have to find the weekday as an integer, compare it to the weekday of Today as an integer, and do some math to get something to add to [Today] to make it next Friday. I'll see if i can find the right formula for it in the mean time.

Edit: ok so you can use WEEKDAY([Today]) to return an integer from 1 (sunday) to 7 (saturday) (Options of WEEKDAY Function), and depending on how you want to determine what 'next week' is, you would add write the formula as something like...

=[Today] + (6 - MOD(WEEKDAY([Today]),7)) + 7

Haven't tested it but that should work!


Similarly, I was asked to set a field as the "Second Thursday of Next Month." Using this post as well as some other tricks I already know, I was able to come up with a formula (shared if other users get the similar request):

=DATE(YEAR(Today),MONTH(Today)+1,(5-MOD(WEEKDAY(DATE(YEAR(Today),MONTH(Today)+1,1)),7)+8))

Because you aren't adding the values to a "Today" field (which would be the first of the month), you add 8 instead of 7 to account for the first day.

Tags:

Date Time