Adding days on calculated column from monday to friday
-
09-02-2021 - |
Domanda
I need to add a calculated column in SharePoint where I have to add +1 day from Monday to Thursday and +3 on Friday but I don't know how to do it. I did some tests with WEEKDAY without success.
Soluzione
You can use WEEKDAY
function like below:
=IF(WEEKDAY(Today())=2,Today()+1,Today())
This will check if today's day is "Monday", If Yes, it will add 1 days to today's date else it will set column value to today's date (Similarly you can add your other conditions to this formula).
Complete formula:
=IF(OR(WEEKDAY(Today())=2,WEEKDAY(Today())=3,WEEKDAY(Today())=4,WEEKDAY(Today())=5),Today()+1,IF(WEEKDAY(Today())=6,Today()+3,Today()))
Reference: WEEKDAY function
Note:
- This function returns the day of the week corresponding to a date. The day is given as an integer, ranging from 1 (Sunday) to 7 (Saturday), by default.
- Sometimes comma(
,
) does not work in formula (I am not sure but it is based on something language or regional settings on your site). So in that case use semicolon(;
) instead of comma(,
). - Return your calculated field as Date and Time.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange