+ Reply to Thread
Results 1 to 5 of 5

Formula to compute last working day of following month

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,765

    Formula to compute last working day of following month

    i have a date in cell A1 which is the first of a month eg 01/06/2022 (date format dd/mm/yyy)

    I need to compute the last working day of the next month, but cannot get it to give me the correct date which should be 29/07/2022(Last working day in July 2022)


    It would be appreciated if someone could kindly amend my formula

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Formula to compute last working day of following month

    Perhaps this?

    =WORKDAY(EOMONTH(A1,1)+1,-1,L2:L13)

    BSB

  3. #3
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,765

    Re: Formula to compute last working day of following month

    Thanks for the help

    Please explain the significance of -1 in the formula +1,-1

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Formula to compute last working day of following month

    Excel will calculate the formula from the middle outward, so the EOMONTH function will fire first. EOMONTH(A1,1) will return the last day of the month AFTER the one you have in A1 which in your example is 31st July.

    The +1 adds a day on to make 1st August and then the WORKDAY function kicks in using 1st August as its starting point. The -1 in the formula is the "DAYS" argument in the WORKDAY function and will mean it returns a date before the starting point of 1st August. If the starting point -1 day is a week day, and not one of the holiday dates specified, then the formula will return that as the result. However if it falls on a weekend the formula will keep working backward until it finds a date BEFORE the starting point (1st August) that is not a holiday and not a weekend, i.e. the results you're looking for.

    Not so easy to explain it would seem... Perhaps the MS Help page for this function will help where I've failed to explain clearly.
    https://support.microsoft.com/en-us/...6-60d494efbf33

    BSB

  5. #5
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,765

    Re: Formula to compute last working day of following month

    Many thanks for the detailed explanation. It makes perfect sense now

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 01-23-2020, 02:23 PM
  2. Replies: 6
    Last Post: 03-28-2017, 09:24 AM
  3. [SOLVED] Date Formula - First of Month Not Working ?
    By Logit in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2017, 12:13 AM
  4. Compute the total elapsed working time
    By rrlarson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-08-2014, 02:06 PM
  5. [SOLVED] Named Range - compute totals by month for several columns
    By SueJB in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-02-2013, 06:48 PM
  6. Compute Month Based on Cell Content
    By yaju1120 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-21-2007, 10:11 AM
  7. [SOLVED] Compute Month
    By M P in forum Excel General
    Replies: 1
    Last Post: 02-06-2006, 09:55 PM

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