I have 25 years of experience developing programs, functions and even macros for Excel and before in Lotus 1-2-3.
The work is very simple, since you only need 4 functions that when you provide a date in a cell it will return the required data. So you can use these functions in the spreadsheet that you want.
I only have two questions, when you ask for the first, second, third and fourth week of the previous month, do you mean the number of the week? or start date of week?. For me it is the same. And, What happens if the month has 5 weeks as March 2018? Are you interested in having 5 weeks?, if the month had them.
I would love to be able to do this project since the excel projects are my favorites.
--------------
P.S.
I was so interested in your project that I already developed it...
This is the example of the Excel sheet:
Date 05/02/2018
First Date 01/01/2018
Last Date 31/01/2018
Second Date 02/01/2018
Weeks 1, 2, 3, 4, 5
Date 06/03/2001
First Date 01/02/2001
Last Date 28/02/2001
Second Date 02/02/2001
Weeks 5, 6, 7, 8, 9
Date 06/03/2000
First Date 01/02/2000
Last Date 29/02/2000
Second Date 02/02/2000
Weeks 6, 7, 8, 9, 10
Date 06/12/2017
First Date 01/11/2017
Last Date 30/11/2017
Second Date 02/11/2017
Weeks 44, 45, 46, 47, 48
Date 30/01/2018
First Date 01/12/2017
Last Date 31/12/2017
Second Date 02/12/2017
Weeks 48, 49, 50, 51, 52, 53
Date 27/03/2015
First Date 01/02/2015
Last Date 28/02/2015
Second Date 02/02/2015
Weeks 6, 7, 8, 9