Days between 2 dates excluding Sundays only

J

JGGL

Hi, I need to get the number of days between 2 dates excluding Sundays
only. I know about networkdays but that exclude all weekend and take
in consideration all week days as 1 day.
Example 1
A2 = Sep 16 (Fri)
B2 = Sep 19 (Mon)
If you do B2-A2 = 3 because Fri = 0 Sat = 1 Sun = 1 and Mon = 1
Using NETWORKDAYS(A2,B2) = 2 because Friday = 1 and Monday = 1
What I need is B2-A2 = 2 Fri = 0 Sat = 0 Sun = 1 and Mon = 1
Result 2

Example 2
A2 = Sep 15 (Thu)
B2 = Sep 16 (Fri)
If you do B2-A2 = 1 because Thu = 0 Fri = 1
Using NETWORKDAYS(A2,B2) = 2 because Thu = 1 and Fri = 1
What I need is B2-A2 = 1 Thu = 0 Fri = 1

Are you able to help me?
 
R

Ron Rosenfeld

Hi, I need to get the number of days between 2 dates excluding Sundays
only. I know about networkdays but that exclude all weekend and take
in consideration all week days as 1 day.
Example 1
A2 = Sep 16 (Fri)
B2 = Sep 19 (Mon)
If you do B2-A2 = 3 because Fri = 0 Sat = 1 Sun = 1 and Mon = 1
Using NETWORKDAYS(A2,B2) = 2 because Friday = 1 and Monday = 1
What I need is B2-A2 = 2 Fri = 0 Sat = 0 Sun = 1 and Mon = 1
Result 2

Example 2
A2 = Sep 15 (Thu)
B2 = Sep 16 (Fri)
If you do B2-A2 = 1 because Thu = 0 Fri = 1
Using NETWORKDAYS(A2,B2) = 2 because Thu = 1 and Fri = 1
What I need is B2-A2 = 1 Thu = 0 Fri = 1

Are you able to help me?


=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A2&":"&B2)))<>1))-1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top