Weekend calculation question

dawnfoss

Board Regular
Hi

Can someone help me with a formula that will return the following:

If A1 = monday through friday then B1= A1 (monday)
If A1 =saturday then B1=A1+2 (monday)
If A1= sunday then B1=A1+1 (monday)

Thanks!
dawn

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
in B1 Try (format B1 as a date):

if(and(Weekday(A1)>1, Weekday(A1)<7),A1,if(weekday(A1)=7,A1+2,A1+1))

In B1:

=IF(WEEKDAY(A1,2) <= 5,
A1 - WEEKDAY(A1, 2) + 1,
A1 - WEEKDAY(A1, 2) + 8)

Dawn:

My formula is assuming that if a Monday to a Friday date is in A1 then you want the Monday date from that week, whereas if A1 contains a Saturday or Sunday date then you want the Monday date from the next week.

I'm assuming that A1 contains a date and you want the next weekday. You could use WORKDAY function from Analysis ToolPak, i.e.

=WORKDAY(A1,1)

or without Analysis ToolPak

=A1+CHOOSE(WEEKDAY(A1),1,1,1,1,1,3,2)

Replies
3
Views
184
Replies
13
Views
819
Replies
5
Views
415
Replies
2
Views
247
Replies
2
Views
160

1,219,580
Messages
6,149,113
Members
450,861
Latest member
metcala

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back