If today() is first monday of this month (regardless of year)

How would I go about doing this?

I’ve tried for hours but I’m stuck.

IF(
  WEEKDAY(
    EOMONTH(
      TODAY(),
      -1
    )+1
  )=2,
  "Yep, the first day of this month is monday",
  "Nah, it's not"
)

4 Likes

Or another option, if understanding of your requirement is correct.

IF( AND(DAY(TODAY())<=7, WEEKDAY(TODAY())=2), 1st Monday of the month, Other day)

3 Likes

This worked great! I didn’t get the other one by @SkrOYC working.

AND(DAY([TodayField])<=7, WEEKDAY([TodayField])=number([DayValue]))

[TodayField] is a test field for Today())
[DayValue] is value for Monday(2), Tuesday(3) etc.

2 Likes

It works for me

It generates the same number (7) on all rows if I try it in virtual column:

WEEKDAY(EOMONTH(Date([TodayField]), -1)+1)

I’ve also tried to populate the TodayField with raw text value (2022/01/03) And still i got (7)

Check the docs around WEEKDAY() and EOMONTH()
Try a date of another month and you will see what I’m talking about

Hi @SkrOYC ,

I think the expression you have built returns if the 1st day of a month is Monday. So I think in the year 2021, your expression will return “Yep, the first day of this month is Monday” for only two months on dates ( 1st November) 01/11/2021 and 01/03/2021 ( 1st March) Is it correct?

I think @Ratatosk is looking for a date that occurs on 1st Monday of any month. So the date can be anywhere from 1 to 7 but the day should be Monday of the month. So the expression should return one date of first Monday of each calendar month. So in 2021, it will be dates of 4th January, 7th February, 1st March, 5th April and so on.

2 Likes

Yep, that’s what I understanded and now I see why it’s not the thing he needed.

Your solution seems the best one for that case since it checks if the day if between the first 7 days of the month and then if it’s monday or not.

3 Likes

Hi @SkrOYC ,

Thank you. You have been contributing so valuably to the community. Your expression is also ingenious, it is just that there was a small error in understanding the requirement that happens sometimes with all of us.

All the best.

3 Likes

I’m sorry, I see that I wasn’t entirely clear. Thanks again for your help!

3 Likes

Nah, I just didn’t get it from the title, that’s all.
I don’t know how I ended up with “If today() is the first month day and it’s monday”

3 Likes