Calculate # days in week based on date range

Peelah

New Member
Joined
Mar 28, 2016
Messages
2
Hi! Looking for some help with a formula for employee vacation requests.

I need to calculate the number of days each week that are requested off based on a vacation request that lists start and end dates. Vacation requests are listed in Columns A & B, and the weeks of the year are listed in Columns C - end.

For example:
A2: 2/2/16 (Employee first day off requested)
B2: 2/9/16 (Employee's last day off requested)

C1: 2/1/16 (want to automatically fill this out based on values in A2 & B2)
D1: 2/8/16
E1: 2/15/16
F1: 2/22/16
G1: 2/29/16
etc, etc

Desired Outcome:
C1: 4
D1: 2


I've come up with this formula, but it doesn't work if a vacation request starts or ends mid week.
=IF(AND($A2<=C$1,$B2>(C$1+6)),NETWORKDAYS(C$1,D$1)-1,0)

Any help will be much appreciated!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi Peelah,

A2: 2/2/16 (Employee first day off requested)
B2: 2/9/16 (Employee's last day off requested)

C1: 2/1/16 (want to automatically fill this out based on values in A2 & B2)

How you got 2/1/16 ? Are you looking forward to show first monday as week here ?


Regards,
DILIPandey
 
Upvote 0
Enter below formula in C2:-

=A2-WEEKDAY(A2,2)+1

and fill down.

It will give you the first monday of the vacation period. Thanks.

Regards,
DILIPandey
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,272
Members
449,219
Latest member
daynle

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
Back
Top