Hi,
Can someone please suggest a formula to calculate, given any particular date, the last weekday in the PREVIOUS month.
Thanks!
Hi,
Can someone please suggest a formula to calculate, given any particular date, the last weekday in the PREVIOUS month.
Thanks!
Last edited by andrewc; 08-26-2010 at 07:20 AM.
If your date is in A1 then :-
Or for the day itself![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Last edited by bd528; 08-26-2010 at 07:10 AM.
Hi, With the date in question in C4, this will give you the date of the last day in last month.
=DATE(YEAR(C4),MONTH(C4),1)-1
You can change the format to DDD or DDDD to give you weekday.
Another possibillity is to enclose the function above in the weekday function. This will return a number to represent the weekday:
=WEEKDAY(DATE(YEAR(C4),MONTH(C4),1)-1)
If needed you can then use lookup or vlookup to present the result the way you want.
Perfect, thanks very much!
You can shorten bd528's suggestion to the following
=A1-DAY(A1)-MAX(0,WEEKDAY(A1-DAY(A1),2)-5)
or if you don't mind using WORKDAY function (which is an Analysis ToolPak add-in function in versions before 2007) you can use this
=WORKDAY(A1-DAY(A1)+1,-1)
Audere est facere
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks