+ Reply to Thread
Results 1 to 11 of 11

Calculating payment dates to exclude weekends and holidays

  1. #1
    Registered User
    Join Date
    09-05-2011
    Location
    Ryther, England
    MS-Off Ver
    Office 365
    Posts
    63

    Smile Calculating payment dates to exclude weekends and holidays

    Hi there

    I am looking for assistence regarding a calculation. I want to be able to calculate a payment date scehdule based on a set monthly payment date but to exclude exclude weekends and specific holiday dates e.g.

    Start date is 28 Jan 2012
    The monthly payment date is 28th of each month
    In theory the next payment date 28 Feb 2012
    However, I need to calculate the next working day if the 28 Feb 2012 happens to fall on a weekend, or falls on a date within list of bespoke ad hoc holiday dates.

    Any help would be greatly appreciated.

    Regards

    Mac
    Attached Files Attached Files
    Last edited by macquhele; 11-10-2011 at 08:23 AM. Reason: To add an attachment sample relating to my query - further attachment update

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,436

    Re: Calculating payment dates to exclude weekends and holidays

    Have a look at the NETWORKDAYS function. That should do what you want.


    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    09-05-2011
    Location
    Ryther, England
    MS-Off Ver
    Office 365
    Posts
    63

    Re: Calculating payment dates to exclude weekends and holidays

    Hi

    Thanks for your reply. I did try the NETWORKDAY formula but this relies on an end date. I attempted the following:

    Cell A1 = Start date 28 Jan 2012
    Payment date 28th of each month
    Cell A2 formula =NETWORKDAYS(A1,DATE(YEAR(A1),MONTH(A1)+1,DAY(A1)),holidays)

    (holidays being my bespoke list of ad hoc holiday dates)

    However, this returned a date of 22 Jan 1900

    What I am attempting is ongoing and has no end date. It's essentially to calculate salary pay days to ensure that each salary is paid on a specifc monthly date or the next availabke working date.

    Hope that makes sense

    Regards

    Mac

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,436

    Re: Calculating payment dates to exclude weekends and holidays

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  5. #5
    Registered User
    Join Date
    09-05-2011
    Location
    Ryther, England
    MS-Off Ver
    Office 365
    Posts
    63

    Re: Calculating payment dates to exclude weekends and holidays

    Hi there

    I have added an attachment to support the query.

    Regards

    Mac

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,436

    Re: Calculating payment dates to exclude weekends and holidays

    Maybe in B5:

    =B4+NETWORKDAYS($B$4,DATE(YEAR($B$4),MONTH($B$4)+1,DAY($B$4)),holidays)

    or:

    =$B4+NETWORKDAYS($B4,DATE(YEAR($B4),MONTH($B4)+1,DAY($B4)),holidays)

    and copy down.

    Not sure what dates you're expecting so you might have to play about a bit.


    Regards

  7. #7
    Registered User
    Join Date
    09-05-2011
    Location
    Ryther, England
    MS-Off Ver
    Office 365
    Posts
    63

    Re: Calculating payment dates to exclude weekends and holidays

    Hi again

    I tried your suggestion. It certainly returned a date closer that what my effort did lol.

    To illustrate the expected results I have further updated the attachement to clarify my needs with this query. Thanks once again for taking time to help.

    Regards

    Mac

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

    Re: Calculating payment dates to exclude weekends and holidays

    Hello Mac, did you find an answer to this yet?

    You can use EDATE function in conjunction with WORKDAY. EDATE will add the correct number of month, WORKDAY will give you the next workday if that lands on a weekend or holiday - try this formula in B5 copied down

    =WORKDAY(EDATE(B$4,ROWS(B$5:B5))-1,1,O$1:O$9)
    Audere est facere

  9. #9
    Registered User
    Join Date
    06-13-2010
    Location
    Plymouth, England
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Calculating payment dates to exclude weekends and holidays

    Great solution however is there a way of reversing this so that if the 28th was to land either on a saturday, sunday or bank holiday it would default to the previous weekday ie friday or thursday if landed on good friday?

    Many thanks
    Enjoy ! ! !

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

    Re: Calculating payment dates to exclude weekends and holidays

    Just swap the -1 and the 1, i.e.

    =WORKDAY(EDATE(B$4,ROWS(B$5:B5))+1,-1,O$1:O$9)

  11. #11
    Registered User
    Join Date
    06-13-2010
    Location
    Plymouth, England
    MS-Off Ver
    Excel 2010
    Posts
    58

    Re: Calculating payment dates to exclude weekends and holidays

    Thanks very much

+ 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