Excel Formula

uab_00

New Member
Joined
Feb 5, 2016
Messages
25
Hi I;m trying to create a Maternity Leave calculator, If I have a due date and I want to start my maternity Leave 14 days before due date, how can I do?I know if I do the due date - 14 I got it, but what about if the due date is on a Saturday or Sunday and I want my Maternity Leave start on the following Monday?
And what about the return to work day?I know that I have 26 weeks from the start of My Maternity, same as above my Maternity end on a Saturday or Sunday and I want my Return to work start on the following Monday?
Thanks
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,388
Office Version
  1. 365
Platform
  1. Windows
This formula will either give you the same date if its a weekday in A1 or the following Monday if a weekend date is placed in A1:

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

uab_00

New Member
Joined
Feb 5, 2016
Messages
25
Thanks a lot and what about if I want to keep the cell blank if the due date is not entered and If I want to subtract from the due date 14 days?

I put the below but it does not work, the due date is placed in b6

=IF(B6="","",B6-14,B6+choose(weekday(B6),1,0,0,0,0,0,2))
Thanks
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,388
Office Version
  1. 365
Platform
  1. Windows
That would be

=IF(A1="","",A1-14+CHOOSE(WEEKDAY(A1-14),1,0,0,0,0,0,2))
 

Watch MrExcel Video

Forum statistics

Threads
1,129,812
Messages
5,638,489
Members
417,028
Latest member
JFCLUK

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top