+ Reply to Thread
Results 1 to 8 of 8

Thread: formula for finding Friday

  1. #1
    EdStevens
    Guest

    formula for finding Friday

    Looping through a series of cells with dates, need to compute from the
    given date the date of the following Friday. If the given date *is*
    Friday, I need that date returned, not the date of the Friday of the
    following week.

    Thanks.


  2. #2
    Registered User
    Join Date
    04-21-2006
    Posts
    61
    Well, Weekday(Date) will return an integer to represent the day of the week, so you can just use a 'Case' structure to vary the response based on the current day fo the week can't you (IF today is Monday, then return today + 5 etc...)

    Remember, unless you specify otherwise, Weekday(Date) will return 1 for Sunday, 2 for Monday etc...

    If you need code, I can find some for you...

    Regards,
    Gareth

  3. #3
    Chip Pearson
    Guest

    Re: formula for finding Friday

    Try

    =A1+CHOOSE(WEEKDAY(A1),5,4,3,2,1,0,6)

    where A1 is your starting date.

    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com

    "EdStevens" <quetico_man@yahoo.com> wrote in message
    news:1150115227.608532.197970@y43g2000cwc.googlegroups.com...
    > Looping through a series of cells with dates, need to compute
    > from the
    > given date the date of the following Friday. If the given date
    > *is*
    > Friday, I need that date returned, not the date of the Friday
    > of the
    > following week.
    >
    > Thanks.
    >




  4. #4
    Registered User
    Join Date
    04-21-2006
    Posts
    61
    Ignore mine! Chip know best!

    I think I'll impliment this in some of my own code...

  5. #5
    Don Guillett
    Guest

    Re: formula for finding Friday

    you said looping so here is a looping macro

    Sub iffriday()
    For Each c In Selection
    If Application.Weekday(c) = 6 Then MsgBox c.Address
    Next
    End Sub

    --
    Don Guillett
    SalesAid Software
    dguillett1@austin.rr.com
    "EdStevens" <quetico_man@yahoo.com> wrote in message
    news:1150115227.608532.197970@y43g2000cwc.googlegroups.com...
    > Looping through a series of cells with dates, need to compute from the
    > given date the date of the following Friday. If the given date *is*
    > Friday, I need that date returned, not the date of the Friday of the
    > following week.
    >
    > Thanks.
    >




  6. #6
    Bob Phillips
    Guest

    Re: formula for finding Friday

    =A1+6-WEEKDAY(A1)

    --
    HTH

    Bob Phillips

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

    "EdStevens" <quetico_man@yahoo.com> wrote in message
    news:1150115227.608532.197970@y43g2000cwc.googlegroups.com...
    > Looping through a series of cells with dates, need to compute from the
    > given date the date of the following Friday. If the given date *is*
    > Friday, I need that date returned, not the date of the Friday of the
    > following week.
    >
    > Thanks.
    >




  7. #7
    Dana DeLouis
    Guest

    Re: formula for finding Friday

    Just another option:
    =A1+MOD(138612,WEEKDAY(A1)+6)

    --
    HTH. :>)
    Dana DeLouis
    Windows XP, Office 2003


    "EdStevens" <quetico_man@yahoo.com> wrote in message
    news:1150115227.608532.197970@y43g2000cwc.googlegroups.com...
    > Looping through a series of cells with dates, need to compute from the
    > given date the date of the following Friday. If the given date *is*
    > Friday, I need that date returned, not the date of the Friday of the
    > following week.
    >
    > Thanks.
    >




  8. #8
    EdStevens
    Guest

    Re: formula for finding Friday


    Chip Pearson wrote:
    > Try
    >
    > =A1+CHOOSE(WEEKDAY(A1),5,4,3,2,1,0,6)
    >
    > where A1 is your starting date.
    >
    > --
    > Cordially,
    > Chip Pearson
    > Microsoft MVP - Excel
    > Pearson Software Consulting, LLC
    > www.cpearson.com
    >
    > "EdStevens" <quetico_man@yahoo.com> wrote in message
    > news:1150115227.608532.197970@y43g2000cwc.googlegroups.com...
    > > Looping through a series of cells with dates, need to compute
    > > from the
    > > given date the date of the following Friday. If the given date
    > > *is*
    > > Friday, I need that date returned, not the date of the Friday
    > > of the
    > > following week.
    > >
    > > Thanks.
    > >


    Perfect. Thank you.


+ 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.2.0