+ Reply to Thread
Results 1 to 8 of 8

Date function: 1st, 3rd and 5th Mondays of a month

  1. #1

    Date function: 1st, 3rd and 5th Mondays of a month

    Hello:

    I wanted the value of a cell to change (either "yes" or "No") based on
    the following date conditions:

    Return "Yes" if today's date was either the 1st or 3rd or 5th MONDAY of
    the month (else value = false)

    Is it possible to do so using a formula?
    If not what would be the VBA code required for this?

    Would appreciate help with this

    TIA
    Vinay


  2. #2
    Mika
    Guest

    Re: Date function: 1st, 3rd and 5th Mondays of a month

    See http://www.cpearson.com/excel/DateTimeWS.htm


  3. #3
    Tom Ogilvy
    Guest

    Re: Date function: 1st, 3rd and 5th Mondays of a month

    Look at Chip Pearson's site and you can combine some of the formulas there
    to do what you want:

    http://www.cpearson.com/excel/DateTimeWS.htm#NthDoWYear

    if you want to use VBA, you can find that as well:

    http://www.cpearson.com/excel/DateTimeVBA.htm#NDow

    --
    Regards,
    Tom Ogilvy


    <[email protected]> wrote in message
    news:[email protected]...
    > Hello:
    >
    > I wanted the value of a cell to change (either "yes" or "No") based on
    > the following date conditions:
    >
    > Return "Yes" if today's date was either the 1st or 3rd or 5th MONDAY of
    > the month (else value = false)
    >
    > Is it possible to do so using a formula?
    > If not what would be the VBA code required for this?
    >
    > Would appreciate help with this
    >
    > TIA
    > Vinay
    >




  4. #4

    Re: Date function: 1st, 3rd and 5th Mondays of a month

    Thanks Mika & Tom
    Will give Pearson's site a try
    Vinay


  5. #5
    K Dales
    Guest

    Re: Date function: 1st, 3rd and 5th Mondays of a month

    Here is a formula in "one shot" that should do it:
    =IF(AND(WEEKDAY(TODAY(),2)=1,OR(DAY(TODAY())<8,AND(DAY(TODAY())>14,DAY(TODAY())<22),DAY(TODAY())>28)),"YES","NO")
    --
    - K Dales


    "Tom Ogilvy" wrote:

    > Look at Chip Pearson's site and you can combine some of the formulas there
    > to do what you want:
    >
    > http://www.cpearson.com/excel/DateTimeWS.htm#NthDoWYear
    >
    > if you want to use VBA, you can find that as well:
    >
    > http://www.cpearson.com/excel/DateTimeVBA.htm#NDow
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello:
    > >
    > > I wanted the value of a cell to change (either "yes" or "No") based on
    > > the following date conditions:
    > >
    > > Return "Yes" if today's date was either the 1st or 3rd or 5th MONDAY of
    > > the month (else value = false)
    > >
    > > Is it possible to do so using a formula?
    > > If not what would be the VBA code required for this?
    > >
    > > Would appreciate help with this
    > >
    > > TIA
    > > Vinay
    > >

    >
    >
    >


  6. #6
    Ron Rosenfeld
    Guest

    Re: Date function: 1st, 3rd and 5th Mondays of a month

    On 1 Nov 2005 04:50:12 -0800, [email protected] wrote:

    >Hello:
    >
    >I wanted the value of a cell to change (either "yes" or "No") based on
    >the following date conditions:
    >
    >Return "Yes" if today's date was either the 1st or 3rd or 5th MONDAY of
    >the month (else value = false)
    >
    >Is it possible to do so using a formula?
    >If not what would be the VBA code required for this?
    >
    >Would appreciate help with this
    >
    >TIA
    >Vinay



    =IF(AND(WEEKDAY(A1)=2,MOD(INT((DAY(A1)-1)/7),2)=0),"Yes","No")

    Substitute TODAY() for A1 in the formula; or enter =TODAY() into A1 (or some
    other referenced cell).


    --ron

  7. #7

    Re: Date function: 1st, 3rd and 5th Mondays of a month

    Thanks to K Dales, & Ron.
    Both solutions worked
    Vinay


  8. #8

    Re: Date function: 1st, 3rd and 5th Mondays of a month

    Thanks to K Dales, & Ron.
    Both solutions worked
    Vinay


+ 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