Results 1 to 3 of 3

Thread: IMM - 3rd Wednesday of Month

  1. #1

    Thread Starter
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    IMM - 3rd Wednesday of Month

    In finance there is a trade type call IMM dates- "International Money Market" dates
    Essentially this means that the trade repeats on the third wednesday of each month.
    How can I calculate this, given a random start date, using Excel?

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: IMM - 3rd Wednesday of Month

    Have a look in the help files for date functions... specifically weekday.
    Then you need to figure out if the first day of the month is before or after the wednesday to get its date then add on 21 (days).

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    Re: IMM - 3rd Wednesday of Month

    how about
    Code:
    Public Sub test()
    
    If Weekday((Date - (Day(Date) - 1)), vbMonday) = 3 Then
    'first day of month was wendsday
        ActiveSheet.Cells(2, 1) = Date - Day(Date) + 15
    ElseIf Weekday((Date - (Day(Date) - 1)), vbMonday) < 3 Then
    'first day of month was weekday before wendsday
        ActiveSheet.Cells(2, 1) = Date - Day(Date) + 15 + (3 - Weekday((Date - (Day(Date) - 1)), vbMonday))
    Else
    'first day of month was weekday after wendsday
        ActiveSheet.Cells(2, 1) = Date - Day(Date) + 15 + (10 - Weekday((Date - (Day(Date) - 1)), vbMonday))
    End If
    End Sub
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

Posting Permissions

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



Click Here to Expand Forum to Full Width