date: how to get the last day of december last year?

choubix

Board Regular
Joined
Jul 3, 2008
Messages
85
hello,

I think everything is in the title ;)
I have a start date: eomonth(today())
now I'd need to return the last day (preferably not a week end) of the month of december last year.

I believe it is quite easy when you know how to pile up the date functions but I have difficulties coming up with a solution for this one.

can someone suggest me how to ahndle this please?

thanks!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
To get the last weekday of the year (Mon-Fri), perhaps:

=DATE(YEAR(TODAY()),1,LOOKUP(WEEKDAY(DATE(YEAR(TODAY()),1,0)),{1,2,3,4,5,6,7},{-2,0,0,0,0,0,-1}))

This assumes Sunday=1, Monday=2...Saturday=7.
 
Upvote 0
thanks! used the first formula and it works fine. jsut need to adjust with a -1 or -2 to get the date I need to use.
 
Upvote 0
You're welcome. The second formula is written so that you don't have to manually adjust for -1 or -2, it finds the last day of the year, determines the day of the week and then subtracts 0, 1 or 2 automatically. Mon-Fri = 0, Sat = -1, Sun = -2.

Up to you which suits you best, though. Cheers.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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