How many weeks fall within the program dates

cjlittlet

New Member
Joined
Dec 2, 2021
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I need help finding a formula or set of formulas that will tell me what I need to know.

I have to take a date range and then calculate how many weeks under each program a person qualified for based on the number of Saturdays.

program dates:
program 1: 04.04.20 - 07.25.20
program 2: 08.01.20 - 09.12.20
program 3: 01.02.21 - 03.13.21
program 4: 03.20.21 - 06.26.21

For example:
if a person was active from 04.13.20 to 02.15.21 then it would say something like
Program1: 15
Program2: 7
Program3: 7
Program4: 0

wb example.xlsm
ABCDEFGHIJ
1FIRST NAMELAST NAMEID#Wk StartWk StopPrg1Prg2Prg3Prg4Date Entered
206.13.2006.13.20105.23.22
306.13.2006.20.20205.31.22
406.06.2006.06.20105.23.22
502.06.2102.20.21305.23.22
606.06.2009.05.207605.23.22
Sheet1
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
How about:

Book1
ABCDEFGHIJKLMN
1First NameLast NameID#StartStopPrg1Prg2Prg3Prg4ProgramStartStop
2JohnDoe14/13/20202/26/202115780Prg14/4/20207/25/2020
3Prg28/1/20209/12/2020
4Prg31/2/20213/13/2021
5Prg43/20/20216/26/2021
Sheet11
Cell Formulas
RangeFormula
F2:I2F2=LET(s,MAX($D2,VLOOKUP(F$1,$L$2:$N$5,2,0)),e,MIN($E2,VLOOKUP(F$1,$L$2:$N$5,3,0)),IF(e-s>0,NETWORKDAYS.INTL(s,e,"1111101"),0))
 
Upvote 0
Solution
How about:

Book1
ABCDEFGHIJKLMN
1First NameLast NameID#StartStopPrg1Prg2Prg3Prg4ProgramStartStop
2JohnDoe14/13/20202/26/202115780Prg14/4/20207/25/2020
3Prg28/1/20209/12/2020
4Prg31/2/20213/13/2021
5Prg43/20/20216/26/2021
Sheet11
Cell Formulas
RangeFormula
F2:I2F2=LET(s,MAX($D2,VLOOKUP(F$1,$L$2:$N$5,2,0)),e,MIN($E2,VLOOKUP(F$1,$L$2:$N$5,3,0)),IF(e-s>0,NETWORKDAYS.INTL(s,e,"1111101"),0))
Hi Eric, this is perfect! I added an equal sign to the if(e-s>=0.... so it would give me single weeks as well. Thank you so much for the quick response.
 
Upvote 0
@Eric W I posted another request similar to this one. Would you mind terribly taking a look? I'm not sure if I explained what I'm looking for very well.
 
Upvote 0

Forum statistics

Threads
1,214,621
Messages
6,120,563
Members
448,972
Latest member
Shantanu2024

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