+ Reply to Thread
Results 1 to 6 of 6

WORKDAY + Beginning of Month!

  1. #1
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    WORKDAY + Beginning of Month!

    Hi all,

    I would like to ask whether someone can assist me with the attached file.

    Basically, I have two dates inserted in a workbook:
    -one in cell A3 e.g. 01/01/2017
    - another in cell B3. e.g. 31/05/2017

    Would it be possible to put a formula in, say, cell E3 which basically would calculate all the firstworking days for each month which falls between the period 01/01/2017 to 31/05/2017 (i.e the dates found in cell A3 and B3)?

    In the file attached, I have included manually what I would like to obtain!


    Would really appreciate a lot your kind help!

    (P.S: I had posted something similar which,however, required the endofmonth rather than the beggining and was wondering whether it could also be done for the beggining of the month)

    Thanks a lot

    Keibri
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: WORKDAY + Beginning of Month!

    In E3, array-enter (enter using Ctrl-Shift-Enter) this formula, which assumes that you have a list of your holidays in a range named "Holidays"

    =MIN(IF(WORKDAY(DATE(YEAR($A$3),MONTH($A$3)+(COLUMN(A1)-1),1)+{-1,0,1,2,3,4,5},1,Holidays)=DATE(YEAR($A$3),MONTH($A$3)+(COLUMN(A1)-1),1)+{0,1,2,3,4,5,6},DATE(YEAR($A$3),MONTH($A$3)+(COLUMN(A1)-1),1)+{0,1,2,3,4,5,6}))

    and copy to the right for 4 more columns.

    It gets a bit more complicated if you need it to check the date range - but as long as the second date is the end of a month, we can simplify to this (also array-entered using Ctrl-Shift-Enter)

    =IF(DATEDIF($A$3,$B$3,"m")>=COLUMN(A1)-1,MIN(IF(WORKDAY(DATE(YEAR($A$3),MONTH($A$3)+(COLUMN(A1)-1),1)+{-1,0,1,2,3,4,5},1,Holidays)=DATE(YEAR($A$3),MONTH($A$3)+(COLUMN(A1)-1),1)+{0,1,2,3,4,5,6},DATE(YEAR($A$3),MONTH($A$3)+(COLUMN(A1)-1),1)+{0,1,2,3,4,5,6})),"")

    Then copy to the right until it returns blanks.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: WORKDAY + Beginning of Month!

    Try like this

    In E3 put
    =WORKDAY($A3-1,1)

    In F3 and filled right as far as required
    =IFERROR(1/(1/IF(MONTH(E3)=MONTH($B3),"",WORKDAY(EOMONTH(E3,0),1))),"")

  4. #4
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Re: WORKDAY + Beginning of Month!

    Wow! Cheers guys tried both solutions and they worked great!That's some awesome coding! thanks a lot! appreciate it!
    Last edited by Keibri; 11-23-2016 at 04:55 PM.

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: WORKDAY + Beginning of Month!

    You're welcome.

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: WORKDAY + Beginning of Month!

    Boy, did I over-complicate that....

+ 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. [SOLVED] EOMONTH + WORKDAY for more than 1 month!
    By Keibri in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-22-2016, 06:12 AM
  2. [SOLVED] Calculation of days per month for dates beginning in one month and ending in another month
    By Fahrettin in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-07-2015, 04:52 PM
  3. VB Help - Month Beginning Month End Variable
    By Jonesey_MFC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2012, 11:13 AM
  4. [SOLVED] Determine the 2nd WorkDay of a Month
    By Hudas in forum Excel General
    Replies: 7
    Last Post: 03-22-2012, 05:09 PM
  5. Find First Workday of Month Value Excl Holiday
    By the.ronin in forum Excel General
    Replies: 8
    Last Post: 04-14-2011, 10:09 PM
  6. calculate workday before x month
    By XLS-EXCEL in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-05-2007, 11:59 AM
  7. Excel2000 VBA: First workday of month
    By Arvi Laanemets in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-09-2005, 03:05 AM

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