Next month second Wednesday date error

I have a current month day (second Wednesday) and the next month second Wednesday.
My problem is the “next” month is always wrong. How can I fix this?
This is what I use for the next month: =WORKDAY.INTL(EOMONTH(A3,+1),-3,“1101111”).
(this is correct now, but next month it will be wrong).

Sample file included. Thanks for any suggestions or help.
current-next month.ods (13.8 KB)

  1. -3 doesn’t necessarily gives the correct day, since the number of Wednesdays in a given month may be 4 or 5.
  2. When the first day of the month is already Wednesday, you want to find the immediately following Wednesday, which will be the second one in the month.

In B4:

=WORKDAY.INTL(EOMONTH(A3;0);2;"1101111")

It adds two “workdays” after the last day of the month prior to the wanted. It doesn’t matter if that last day itself will happen to be Wednesday or not - it will be ignored anyway, and you will get exactly the second Wed in the wanted month.

Note that it is the same as in your formula for “this” month.

1 Like

ask112098.ods (22.6 KB)

Mike,
Thanks, that is just what I was looking for. :+1:

Villeroy,
Mike provided a more direct answer to my question. Your provided a way
if I wanted to list a series of dates. Thank you, I’ll keep that as a reference
for a later usage.

The formula gets the first occurrence of any weekday in any given month using very simple functions. For the next month, replace MONTH(ref) with MONTH(ref)+1 (which I did in column A in order to test more values).

Another formula for the first Wednesday, starting from the date in cell A1:

=A1+6-MOD(A1+2;7)