Forum Discussion
Need help with syntax error
- Mar 10, 2023
KCarp0113 you're getting the syntax error because the WORKDAY function doesn't exist in SharePoint, it is only for Excel.
For part of your fomula it looks as though you want to get the number of working days between 2 dates. So you need to be using a combination of DATEDIF AND WEEKDAY (where Start and End are my date/time columns):
=(DATEDIF(Start,End,"D"))-INT(DATEDIF(Start,End,"D")/7)*2-IF(WEEKDAY(End)<WEEKDAY(Start),2,IF(OR(WEEKDAY(End)=7,WEEKDAY(Start)=1),1,0))Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
KCarp0113 you're getting the syntax error because the WORKDAY function doesn't exist in SharePoint, it is only for Excel.
For part of your fomula it looks as though you want to get the number of working days between 2 dates. So you need to be using a combination of DATEDIF AND WEEKDAY (where Start and End are my date/time columns):
=(DATEDIF(Start,End,"D"))-INT(DATEDIF(Start,End,"D")/7)*2-IF(WEEKDAY(End)<WEEKDAY(Start),2,IF(OR(WEEKDAY(End)=7,WEEKDAY(Start)=1),1,0))
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
RobElliott Thank you for your help! I was able to modify your formula a bit and combine it with my original to get the results I wanted. I sometimes forget which functions don't crossover. Thanks again!