Forum Discussion

4 Replies

  • IlirU's avatar
    IlirU
    Iron Contributor

    MarkBeck54​,

    Use below formula.

    =LET(
      y, 2026,
    mth, 9,
     dt, DATE(y, mth, 1),
      d, DATE(y, mth, SEQUENCE(EOMONTH(dt, 0) - dt + 1)),
     wd, WEEKDAY(d, 2),
    wed, TOCOL(d / (wd = 3), 3),
    thu, TOCOL(d / (wd = 4), 3),
         IF(WEEKNUM(MAX(TOCOL(d / (wd = 3), 3)), 2) = WEEKNUM(MAX(TOCOL(d / (wd = 4), 3)), 2), MAX(wed), MAX(DROP(wed, -1)))
    )

    Change the year and month in formula as per you need.

    Hope this helps.

    IlirU

    • m_tarler's avatar
      m_tarler
      Bronze Contributor

      Alternatively:

      =EOMONTH(A1,0) - WEEKDAY(EOMONTH(A1,0),14)

      Here are the 3 options tested on April and Sept of 2026 where the last day of the month is on a Thurs and a Wed respectively:

       

  • Olufemi7's avatar
    Olufemi7
    Iron Contributor

    Hello MarkBeck54​,
    Use the formula =EOMONTH(A1,0) - WEEKDAY(EOMONTH(A1,0)-3,1) where A1 contains any date in the month. This returns the last Wednesday whose following Thursday is still in the same month.