1 Reply Latest reply on Jun 12, 2012 8:24 AM by philmodjunk

    Formula to work out 2nd Tuesday of Every Month

    jake

      Title

      Formula to work out 2nd Tuesday of Every Month

      Post

      Can anyone help me with a formula to work out the actual date of the second Tuesday or second Friday or Every month?

        • 1. Re: Formula to work out 2nd Tuesday of Every Month
          philmodjunk

          DateField - day ( datefield ) + 1

          will compute the date for the first day of the month.

          Let ( [D1 = Datefield - day ( dateField ) + 1 ;
                   Dw = dayOfWeek ( D1 )
                 ];
                   D1 + Choose ( D2 ; "" ; 9 ; 8 ; 7 ; 13 ; 12 ; 11 ; 10 )
                )

          Or you can use:

          Let ( [D1 = Datefield - day ( dateField ) + 1 ;
                   Dw = dayOfWeek ( datefield )
                 ];
                 D1 + 7 * ( 1 + Dw > 3 ) + 3 - Dw
               )