Airtable: Formula to Output the Last Weekday of Current Month

Screenshot of code snippet

This formula is self-explanatory. It uses the NOW() function to output the date of whatever the final weekday of the current month.

IF(
    WEEKDAY(DATEADD(DATETIME_PARSE(DATETIME_FORMAT(DATEADD(NOW(), 1, 'month'), 'YYYY-MM') & '-01'), -1, 'days')) = 0,
    DATEADD(DATETIME_PARSE(DATETIME_FORMAT(DATEADD(NOW(), 1, 'month'), 'YYYY-MM') & '-01'), -3, 'days'),
    IF(
        WEEKDAY(DATEADD(DATETIME_PARSE(DATETIME_FORMAT(DATEADD(NOW(), 1, 'month'), 'YYYY-MM') & '-01'), -1, 'days')) = 6,
        DATEADD(DATETIME_PARSE(DATETIME_FORMAT(DATEADD(NOW(), 1, 'month'), 'YYYY-MM') & '-01'), -2, 'days'),
        DATEADD(DATETIME_PARSE(DATETIME_FORMAT(DATEADD(NOW(), 1, 'month'), 'YYYY-MM') & '-01'), -1, 'days')
    )
)
Michael Avatar

Leave a Reply

Your email address will not be published. Required fields are marked *