Workday() with Sunday as holiday

In the current syntax of workday(), both Saturday and Sunday are considered as the weekend, I want to consider the weekend as Sunday only, how do I write an expression for this 

for example, I have a column named [MRF raised date], I want to get the 5th working day from that [MRF raised date] considering sunday as weekend (Satuday is a working day)

Solved Solved
0 3 183
1 ACCEPTED SOLUTION

The below response is your earlier post that you later deleted and substituted with the below quoted message.

"The [MRF raised date] can be on Sunday as well"

Okay. Then please share some examples of  [MRF raised date] date being on Sunday , Monday, Tuesday and Wednesday and what you would like the corresponding date after 5 working days in each case.

Suvrutt_Gurjar_0-1686911666681.png

In general the below expression should work. If not please provide the above details.

IFS(

        WEEKDAY([MRF raised date])<=2, [MRF raised date]+5,
        WEEKDAY([MRF raised date])>2, [MRF raised date]+6

         )

Edit: Since the [MRF raised date]  can be on all 7 days of the week , the above expression could be further simplified as 

IF(

        WEEKDAY([MRF raised date])<=2,

                                                                       [MRF raised date]+5,
                                                                       [MRF raised date]+6

         )

 


@rakesh7736 wrote:

If I Could get the number of working days between ([MRF raised date]) and ([MRF Closed date]) by considering Sunday as weekend


This can be possibly worked out but it will not be straight forward. You will also need to provide more details as to how much maximum difference can be there between [MRF raised date]) and ([MRF Closed date]. Will it be less than a week always ( as you mentioned 5 days earlier) . If it can exceed 1 week, then the expression can get complex.

Edit: My one request will be to provide sufficient details to your requirements as expressions with dates can be complex. You may also want to take a look at the below post.

How to make a good question - Google Cloud Community

 

View solution in original post

3 REPLIES 3


@rakesh7736 wrote:

I have a column named [MRF raised date], I want to get the 5th working day from that [MRF raised date] considering sunday as weekend (Satuday is a working day)


Please try

IFS(

        WEEKDAY([MRF raised date])=2, [MRF raised date]+5,
        WEEKDAY([MRF raised date])>2, [MRF raised date]+6

         )

The expression assumes, the  [MRF raised date] cannot be on a Sunday.

@Suvrutt_Gurjar 

My problem will also get solved (in a better way)

If I Could get the number of working days between ([MRF raised date]) and ([MRF Closed date]) by considering Sunday as weekend

The below response is your earlier post that you later deleted and substituted with the below quoted message.

"The [MRF raised date] can be on Sunday as well"

Okay. Then please share some examples of  [MRF raised date] date being on Sunday , Monday, Tuesday and Wednesday and what you would like the corresponding date after 5 working days in each case.

Suvrutt_Gurjar_0-1686911666681.png

In general the below expression should work. If not please provide the above details.

IFS(

        WEEKDAY([MRF raised date])<=2, [MRF raised date]+5,
        WEEKDAY([MRF raised date])>2, [MRF raised date]+6

         )

Edit: Since the [MRF raised date]  can be on all 7 days of the week , the above expression could be further simplified as 

IF(

        WEEKDAY([MRF raised date])<=2,

                                                                       [MRF raised date]+5,
                                                                       [MRF raised date]+6

         )

 


@rakesh7736 wrote:

If I Could get the number of working days between ([MRF raised date]) and ([MRF Closed date]) by considering Sunday as weekend


This can be possibly worked out but it will not be straight forward. You will also need to provide more details as to how much maximum difference can be there between [MRF raised date]) and ([MRF Closed date]. Will it be less than a week always ( as you mentioned 5 days earlier) . If it can exceed 1 week, then the expression can get complex.

Edit: My one request will be to provide sufficient details to your requirements as expressions with dates can be complex. You may also want to take a look at the below post.

How to make a good question - Google Cloud Community

 

Top Labels in this Space