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

choubix

Board Regular
Joined
Jul 3, 2008
Messages
76
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!
 

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

mvptomlinson

Well-known Member
Joined
Mar 10, 2008
Messages
2,638
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.
 

choubix

Board Regular
Joined
Jul 3, 2008
Messages
76
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.
 

mvptomlinson

Well-known Member
Joined
Mar 10, 2008
Messages
2,638
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.
 

barry houdini

MrExcel MVP
Joined
Mar 23, 2005
Messages
20,825
For last WEEKDAY of last year try using WORKDAY, i.e.

=WORKDAY(DATE(YEAR(TODAY()),1,1),-1)
 

Watch MrExcel Video

Forum statistics

Threads
1,123,535
Messages
5,602,217
Members
414,513
Latest member
junbuggle

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
Top