+ Reply to Thread
Results 1 to 5 of 5

Counting Weeks INVOLVED between 2 dates

  1. #1
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421

    Counting Weeks INVOLVED between 2 dates

    I've been having problems coming up with a formula that will take a start date and an end date and come up with the number of weeks INVOLVED within this date range (each week being a Sunday through Saturday). My problems is that the start and end dates could be any day of the week and not necessarily the same day (meaning divisible by 7 doesn't always work). I tried using ROUND((A2-A1)/7,0)+1 where A1 was the start date...and A2 was the end date. The problem I had was if I picked a Monday as the start date, and went 12 days out (The saturday of week2)...it came up stating 3 weeks were involved - AND if I selected a Friday start date and picked the following monday in week 2 - the result was 1 week involved when 2 different weeks were involved.

    My brain is fried from data entry and I'm stuck. Any suggestions or beer would be greatly appreciated! Thank you in advance.
    Last edited by GuruWannaB; 11-03-2008 at 06:10 PM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Counting Weeks INVOLVED between 2 dates

    Try this:
    Please Login or Register  to view this content.
    Does that work for you?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421
    I tried this...however it didnt work when I used the starting date of 11/7/2008(friday of week 1) and used the ending date of 11/10/2008 (Monday of week 2). Althought there is only a span of 4 days, they involve two seperate calendar weeks - so the output should have been 2 - when it came out as only 1.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    If weeks are Sunday to Saturday then this formula counts how many weeks the date range A1 to A2 intersects

    =INT((A2-WEEKDAY(A2)-A1)/7)+2

  5. #5
    Forum Contributor GuruWannaB's Avatar
    Join Date
    01-24-2008
    Location
    An hour due East of Cowtown Ohio
    MS-Off Ver
    2010
    Posts
    421
    Woot! Thanks...that worked perfectly! Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1