Formula to get the last Monday in February

YasserKhalil

Well-known Member
Joined
Jun 24, 2010
Messages
852
Hello
I need a formula that returns the date of the last Monday in February for any year
For example I have the date in A1
01/01/2014
I need the last Monday For the year 2014
 
Apologies. I set for Fridays, not Mondays.
'Sides, VOG's formula is much simpler.
Excel 2010
ABC
101/01/2013Mon 25-Feb-13Mon 25-Feb-13
201/01/2015Mon 23-Feb-15Mon 23-Feb-15
301/01/2016Mon 29-Feb-16Mon 29-Feb-16
401/01/2012Mon 27-Feb-12Mon 27-Feb-12

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B1=DATE(YEAR(A1),3,1)-WEEKDAY(DATE(YEAR(A1),3,6))

<tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
C1{=MAX((MONTH(DATE(YEAR(A1),2,{21,22,23,24,25,26,27,28,29}))=2)*(WEEKDAY(DATE(YEAR(A1),2,{21,22,23,24,25,26,27,28,29}), 2)=1)*DATE(YEAR(A1),2,{21,22,23,24,25,26,27,28,29}))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>


/AJ

The result is incorrect (24/2/2014) is not right....
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
I'm getting 24-Feb with both formulae.

Excel 2010
ABC
1Ref DateVog's FormulaAJ's Formula
201/01/2012Mon 27-Feb-12Mon 27-02-12
301/01/2013Mon 25-Feb-13Mon 25-02-13
401/01/2014Mon 24-Feb-14Mon 24-02-14
501/01/2015Mon 23-Feb-15Mon 23-02-15
601/01/2016Mon 29-Feb-16Mon 29-02-16
701/01/2017Mon 27-Feb-17Mon 27-02-17
801/01/2018Mon 26-Feb-18Mon 26-02-18
901/01/2019Mon 25-Feb-19Mon 25-02-19
Sheet1
Cell Formulas
RangeFormula
A2=DATE(2010+ROW(), 1, 1)
B2=DATE(YEAR(A2),3,1)-WEEKDAY(DATE(YEAR(A2),3,6))
C2{=MAX((MONTH(DATE(YEAR(A2),2,{21,22,23,24,25,26,27,28,29}))=2)*(WEEKDAY(DATE(YEAR(A2),2,{21,22,23,24,25,26,27,28,29}), 2)=1)*DATE(YEAR(A2),2,{21,22,23,24,25,26,27,28,29}))}
Press CTRL+SHIFT+ENTER to enter array formulas.

/AJ
 
Upvote 0
Code:
=DATE(YEAR(A2);3;1)-WEEKDAY(DATE(YEAR(A2);3;6))
In this formula 3 refers to March .. What about 6 at the end of the formula?
 
Upvote 0
It takes the 1st of march thyen subtracts the weekday of the 6th of march. WEEKDAY counts Sunday as 1.
Thank you very much for great help
Your formula can be easily used with any month ..
What about if I want to change Monday with Thursday for example? Will I change the number 6 at the end of your formula?
 
Upvote 0
Changing the 6 to 3 appears to give the correct result but I have not tested it thoroughly.
 
Upvote 0

Forum statistics

Threads
1,216,661
Messages
6,131,974
Members
449,692
Latest member
MAV57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top