Last Tuesday or Thursday for the current month.
Solved
nonossov
Posted messages
638
Status
Member
-
jcbroadcast Posted messages 2 Status Member -
jcbroadcast Posted messages 2 Status Member -
Hello,
Here is a formula that gives the last day of the month, but I need help finding the nearest Tuesday or Thursday closest to the end of the month. Thank you very much:
Example:
=DATE(YEAR(A1),MONTH(A1)+1,0)-WEEKDAY(DATE(YEAR(A1),MONTH(A1)+1,0),3)
Configuration: Windows / Firefox 52.0
Here is a formula that gives the last day of the month, but I need help finding the nearest Tuesday or Thursday closest to the end of the month. Thank you very much:
Example:
=DATE(YEAR(A1),MONTH(A1)+1,0)-WEEKDAY(DATE(YEAR(A1),MONTH(A1)+1,0),3)
Configuration: Windows / Firefox 52.0
3 answers
-
Hello nonossov
Try this formula
For Tuesday
=EOMONTH(A1,0)+CHOOSE(WEEKDAY(EOMONTH($A$1,0),2),-6,0,-1,-2,-3,-4,-5)
For Thursday
=EOMONTH(A1,0)+CHOOSE(WEEKDAY(EOMONTH($A$1,0),2),-6,0,-1,-2,-3,-4,-5)
--
It is by forging that one becomes a blacksmith. - It is at the foot of the wall that one sees the mason - one always learns from one's mistakes-
Great your formula except that it's the same for Tuesday and Thursday.
I don't see which arguments to change to switch from one to the other.Thanks in advance
Otherwise, I found this one: by putting the 1st day of the month in A1 (01/01/2023 for example)
- =EOMONTH(A1;0)-(7-3+WEEKDAY(EOMONTH(A1;0))) - Returns the last Tuesday
- =EOMONTH(A34;0)-(7-5+WEEKDAY(EOMONTH(A34;0))) - Returns the last Thursday
-
-
Hello
When you receive name
it's a function that is not present in your version of Excel!
Check if you have all the functions of the formula
--
It is by forging that one becomes a blacksmith. - It is at the foot of the wall that one sees the mason - one always learns from one's mistakes. -
Hello nonossov
For both at the same time
=IF(WEEKDAY(EOMONTH(A1,0),2) >=4;EOMONTH($A1,0)+CHOOSE(WEEKDAY(EOMONTH($A1,0),2),0,0,0,0,-1,-2,-3);EOMONTH(A1,0)+CHOOSE(WEEKDAY(EOMONTH($A1,0),2),-4,0,-1,0,0,0,0))
--
It is by forging that one becomes a blacksmith. - It is at the foot of the wall that one sees the mason - one always learns from one's mistakes.