+ Reply to Thread
Results 1 to 7 of 7

Need a formula to count the fridays between two dates

  1. #1
    tiq
    Guest

    Need a formula to count the fridays between two dates

    example:
    cell F1 is the start date 07-01-06
    cell E1 is the end date 07-29-06
    cell F3 is the answer 4

    I just need to count the fridays between two dates

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    =SUM(IF(WEEKDAY(F2-1+ROW(INDIRECT("1:"&TRUNC(F3-F2)+1)))=6,1,0))

    It's an array so need to press Crtl + Shitf + enter to work

    VBA Noob

  3. #3
    Bob Phillips
    Guest

    Re: Need a formula to count the fridays between two dates

    =SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(F1&":"&E1)))=6))

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "tiq" <[email protected]> wrote in message
    news:[email protected]...
    > example:
    > cell F1 is the start date 07-01-06
    > cell E1 is the end date 07-29-06
    > cell F3 is the answer 4
    >
    > I just need to count the fridays between two dates




  4. #4
    Jim Thomlinson
    Guest

    RE: Need a formula to count the fridays between two dates

    Here is an exerpt from Chip Pearson's Site...
    *****************************************
    Number Of Mondays In Period

    If you need to return the number of Monday's (or any other day) that occur
    within an interval between two dates, use the following Array Formula:

    =SUM(IF(WEEKDAY(A2-1+ROW(INDIRECT("1:"&TRUNC(B2-A2)+1)))=C2,1,0))

    This formula assumes the following:
    A2 contains the beginning date of the interval
    B2 contains the ending date of the interval
    C2 contains the day-of-week number (1=Sunday, 2=Monday,...,7=Saturday)
    *****************************************************
    Being an Array formula it must be commited with Ctrl+Shift+Enter when it is
    typed in...

    Here is a link to Chip's site.

    http://www.cpearson.com/excel/DateTimeWS.htm
    --
    HTH...

    Jim Thomlinson


    "tiq" wrote:

    > example:
    > cell F1 is the start date 07-01-06
    > cell E1 is the end date 07-29-06
    > cell F3 is the answer 4
    >
    > I just need to count the fridays between two dates


  5. #5
    Bob Phillips
    Guest

    Re: Need a formula to count the fridays between two dates

    Mine's a bit more obvious Jim <vbg>

    --
    HTH

    Bob Phillips

    (replace somewhere in email address with gmail if mailing direct)

    "Jim Thomlinson" <[email protected]> wrote in message
    news:[email protected]...
    > Here is an exerpt from Chip Pearson's Site...
    > *****************************************
    > Number Of Mondays In Period
    >
    > If you need to return the number of Monday's (or any other day) that occur
    > within an interval between two dates, use the following Array Formula:
    >
    > =SUM(IF(WEEKDAY(A2-1+ROW(INDIRECT("1:"&TRUNC(B2-A2)+1)))=C2,1,0))
    >
    > This formula assumes the following:
    > A2 contains the beginning date of the interval
    > B2 contains the ending date of the interval
    > C2 contains the day-of-week number (1=Sunday, 2=Monday,...,7=Saturday)
    > *****************************************************
    > Being an Array formula it must be commited with Ctrl+Shift+Enter when it

    is
    > typed in...
    >
    > Here is a link to Chip's site.
    >
    > http://www.cpearson.com/excel/DateTimeWS.htm
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "tiq" wrote:
    >
    > > example:
    > > cell F1 is the start date 07-01-06
    > > cell E1 is the end date 07-29-06
    > > cell F3 is the answer 4
    > >
    > > I just need to count the fridays between two dates




  6. #6
    Forum Contributor
    Join Date
    06-01-2006
    Posts
    324
    Just because I like to make things difficult =)

    =IF(6-WEEKDAY(F1)>-1, QUOTIENT((E1-F1-(6-WEEKDAY(F1))),7)+1, QUOTIENT((E1-F1-6), 7)+1)
    Google is your best friend!

  7. #7
    Jim Thomlinson
    Guest

    Re: Need a formula to count the fridays between two dates

    Almost intuitive. We should let Chip know...<vbg>
    --
    HTH...

    Jim Thomlinson


    "Bob Phillips" wrote:

    > Mine's a bit more obvious Jim <vbg>
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (replace somewhere in email address with gmail if mailing direct)
    >
    > "Jim Thomlinson" <[email protected]> wrote in message
    > news:[email protected]...
    > > Here is an exerpt from Chip Pearson's Site...
    > > *****************************************
    > > Number Of Mondays In Period
    > >
    > > If you need to return the number of Monday's (or any other day) that occur
    > > within an interval between two dates, use the following Array Formula:
    > >
    > > =SUM(IF(WEEKDAY(A2-1+ROW(INDIRECT("1:"&TRUNC(B2-A2)+1)))=C2,1,0))
    > >
    > > This formula assumes the following:
    > > A2 contains the beginning date of the interval
    > > B2 contains the ending date of the interval
    > > C2 contains the day-of-week number (1=Sunday, 2=Monday,...,7=Saturday)
    > > *****************************************************
    > > Being an Array formula it must be commited with Ctrl+Shift+Enter when it

    > is
    > > typed in...
    > >
    > > Here is a link to Chip's site.
    > >
    > > http://www.cpearson.com/excel/DateTimeWS.htm
    > > --
    > > HTH...
    > >
    > > Jim Thomlinson
    > >
    > >
    > > "tiq" wrote:
    > >
    > > > example:
    > > > cell F1 is the start date 07-01-06
    > > > cell E1 is the end date 07-29-06
    > > > cell F3 is the answer 4
    > > >
    > > > I just need to count the fridays between two dates

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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