Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Diem Tran   on Oct 07 In MS Office Category.

  
Question Answered By: Clint Garcia   on Oct 07

First, a clarification. Excel starts with 1 for Sunday, not zero, and runs
up to 7 for Saturday. I was thinking of a different language.

First thing to do, probably, is work out whether you have an exact number  of
weeks - simply check for a remainder from the division of the period by 7.
If there isn't a remainder, then you can just take the integer result of the
division as the number of weekends. If there is a remainder, you still use
the integer result as the number of weekends covered by whole weeks. You
only need to handle a possible partial-week weekend, or possibly just an
orphan Saturday or Sunday.

I suspect that the following will work:

- if the end day of week is the same as the start  day of week, then you have
an extra 24 hours if that day is a Sat or Sun

else

- if the end day of week is greater than the start day of week, then you
might have one or two weekend days - add 24 if the start day is Sun and an
extra 24 if the end day is Sat

else (the end day of week is less than the start day of week)

- you have a whole extra weekend (I think) - add 48

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Counting weekends between dates - in Excel VB Or get search suggestion and latest updates.


Tagged: