+ Reply to Thread
Results 1 to 9 of 9

Calendar Days formula...

  1. #1
    Registered User
    Join Date
    02-25-2008
    Location
    Rhode Island
    Posts
    56

    Question Calendar Days formula...

    Hello,

    I'm struggleing with a formula. I have a formula for adding workdays so I tried to use that to add calendar days and it's not working.

    Here's what I typed:
    =if(g3="","",(g3,21))

    I want the result to come back with adding 21 days to the date entered in G3. However, if G3 is blank, then I would like the cell to remain blank.

    Also, is there a formula that I could use were if the date lands on a holiday, could the result be the day prior?

    Any assistance would be appreciated

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calendar Days formula...

    So to be clear: you're saying you want to use all 7 days in your calculation but with the exception of Public Holidays ?

    Which Excel version are you running ?

    Can you post your existing WORKDAY formula ?

  3. #3
    Registered User
    Join Date
    02-25-2008
    Location
    Rhode Island
    Posts
    56

    Re: Calendar Days formula...

    I'm running Excel 2003

    The workday formula that I have is =if(g3="","",workday(g3,21))

  4. #4
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Calendar Days formula...

    Hi,
    Your formula is fine, since Workday() function will automatically skip week-ends ...
    =IF(G3,WORKDAY(G3,21),"")
    HTH

  5. #5
    Registered User
    Join Date
    02-25-2008
    Location
    Rhode Island
    Posts
    56

    Re: Calendar Days formula...

    that will work but, I will need to include weekends, but I'm not sure how to input the forumula to do so.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calendar Days formula...

    Dawn V, perhaps best to illustrate with examples.

    I'm assuming from your post that your intention is to use all days with exception of public holidays - ergo WORKDAY is not valid.

    However, it's not clear what should happen if public holidays occur between G3 and G3+21 -- should the holidays simply be ignored or should we treat the 21 as 21 non public holiday days ?

    I'm guessing we should simply be ignoring any such dates given you state that where G3+21 lands on a Public Holiday we should simply skip back to last non-public holiday date prior to that date.

    Do you have a range configured which holds the public holiday dates ?

  7. #7
    Registered User
    Join Date
    02-25-2008
    Location
    Rhode Island
    Posts
    56

    Re: Calendar Days formula...

    Thank you for your assistance! I really appreciate it.

    Yes, this would be what I am looking for.... I'm guessing we should simply be ignoring any such dates given you state that where G3+21 lands on a Public Holiday we should simply skip back to last non-public holiday date prior to that date.

    No, I do not have the date range. If it is easier, I could just take an example of adding the calendar days.

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calendar Days formula...

    Adding Calendar days is as simple as simple can be - this is all stems from the fact that dates in Excel are simply integers and as such can be added / subtracted etc as per any other number - it's simply that we can format them to appear as dates.

    =IF(G3="","",G3+21)

    would give you your calendar calculation ignoring issues of public holidays.

    Adjusting for public holidays is more convoluted given they could be consecutive ... if we assume the holiday dates are listed in H1:H10 then

    =IF(G3="","",G3+MAX(IF(ISNA(MATCH(G3+ROW(A$1:INDEX(A:A,21)),$H$1:$H$10,0)),ROW(A$1:INDEX(A:A,21)))))
    confirmed with CTRL + SHIFT + ENTER

    would return for you the last date up to and including G3+21 which was not a public holiday.

    If weekends were being ignored we'd simply use WORKDAY and add our optional holiday range.

  9. #9
    Registered User
    Join Date
    02-25-2008
    Location
    Rhode Island
    Posts
    56

    Re: Calendar Days formula...

    Thank you very much! :o)

+ 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