+ Reply to Thread
Results 1 to 5 of 5

Formula to Calculate the Last Weekday of Previous Month

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Formula to Calculate the Last Weekday of Previous Month

    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.

  2. #2
    Forum Contributor
    Join Date
    12-31-2008
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: Formula to Calculate the Last Weekday of Previous Month

    Quote Originally Posted by andrewc View Post
    Hi,

    Can someone please suggest a formula to calculate, given any particular date, the last weekday in the PREVIOUS month.

    Thanks!
    If your date is in A1 then :-

    Please Login or Register  to view this content.
    Or for the day itself

    Please Login or Register  to view this content.
    Last edited by bd528; 08-26-2010 at 07:10 AM.

  3. #3
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Formula to Calculate the Last Weekday of Previous Month

    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.

  4. #4
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Re: Formula to Calculate the Last Weekday of Previous Month

    Perfect, thanks very much!

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Formula to Calculate the Last Weekday of Previous Month

    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1