+ Reply to Thread
Results 1 to 50 of 50

20 days - Return Date from the Calendar days

  1. #1
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    20 days - Return Date from the Calendar days

    Hello,

    Can you to modify the code.

    Please Login or Register  to view this content.
    I want 20 days return date from the date I entered in E3.

    Let say if I enter 3/25/2024 then the date return should be 04/19/2024. Included all the weekends and the holidays that I have put in the W28:W999.


    From the code I want to removed W28:W999 that where I placed the holidays.

    Thanks

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: 20 days - Return Date from the Calendar days

    If you want 20 days instead of 15 then change the 15 to 20. If you want to ignore holidays from the calculation, then omit the range at the end. Like this:


    =IF(E3="","",WORKDAY(E3,20))

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: 20 days - Return Date from the Calendar days

    Hi Pete

    Sorry… I just thought of that i made a wrong scenario.

    I actually need to include the W28:W999. This is a holiday we have in the office.

    I need the result to falls on the weekdays not on the weekend nor the holidays that’s on the W column because I can’t set schedule for the weekdays. Id my results falls on Sunday then my result should be the Monday instead

    thanks

  4. #4
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: 20 days - Return Date from the Calendar days

    I don’t want to type all the weekends with the holidays in W columns.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: 20 days - Return Date from the Calendar days

    WORKDAY formula

    =IF(E3="","",WORKDAY(E3,15,W28:W999))

    never fall into weekend/holiday.

    In case you want E3 not fall in to weekend/Holiday, -1 and +1 may help:

    =IF(E3="","",WORKDAY(E3-1,15+1,W28:W999))
    Quang PT

  6. #6
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: 20 days - Return Date from the Calendar days

    If you do not want to type your holidays in column W, then =IF(E3="","",WORKDAY(E3,20,{"date1","date2"...})), replacing date1 with the 1st holiday date, date2 2nd etc.

  7. #7
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: 20 days - Return Date from the Calendar days

    Hello all,

    I have attached the workshseet here. I using 5 days return to make sure as a sample.

    I just find out that if we use the return date from today, if its falls on the weekend or holiday then, we need to use the weekend before not the forward weekdays.

    Let say today is 03/26/24 so if we count the 5 then the result is 03/31/24 (Sunday). My return should be 03/29/24 to fall back to weekdays (Not 04/02/24).

    Another sample, if I enter the date for 04/02/24 then the result should be 04/05/24 (not 04/08/024)

    Thank you in advance!

    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: 20 days - Return Date from the Calendar days

    Suppose cell A1 contains a date.
    The date after adding 5 days is: A1+5.
    If you want A1+5, and if it falls on a weekend or a holiday, and you want to move it to the nearest weekday, there's a trick:
    Increase A1+5 by 1 day (A1+6), then move it back 1 day using the WORKDAY function.
    If A1+5 is a weekday, nothing will change. But if it falls on a weekend or a holiday, it will be moved back by 1 working day.

    The result will be:

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: 20 days - Return Date from the Calendar days

    If return date falls on a weekend or a holiday and you want to deem the next available working day as the return date, e.g. return date on 6th January (Sat), the next working day is 8th January (not a holiday), then:

    5 days from return date (not counting return date as 1 day):
    =WORKDAY(WORKDAY(E3-1,1,W28:W907),5,W28:W907)

    5 days from return date (counting return date as 1 day):
    =WORKDAY(WORKDAY(WORKDAY(E3-1,1,W28:W907),5,W28:W907),-1,W28:W907)
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: 20 days - Return Date from the Calendar days

    Hello everyone,

    Ok... I came out with something that does work for me. Everything was perfect as I ran or entering the date in E3 but when I enter 02/20/24 and it appears 02/25/24 which is weekend. It should select the 02/26/24. Is this because there is a 29 days in February?

    Here is the new created worksheet. This sample has 5 days

    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: 20 days - Return Date from the Calendar days

    "0000000" parameter mean "no weekend"

    If weekend is Sat and Sun, it should be:

    "0000011"

  12. #12
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: 20 days - Return Date from the Calendar days

    Hello everyone,
    I really need to finish this project. But it seems I am having trouble getting what i am trying to accomplish.

    In my worksheet I added a picture where it supposed to have the result.

    5 Calendar day from 2/20/24 iis 2/26/2024
    5 calendar day from 2/21/24 is 2/26/2024
    5 caelndar day from 2/22/24 is 2/27/2024
    5 calendar day from 2/23/24 is 2/28/2024

    but in the worksheet it not getting what it supposed to be.

    Please fix the formula or maybe change the formula to make it happen.

    Thank you
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: 20 days - Return Date from the Calendar days

    What is the logic that 5 calendar days from 2/20/24 (Tuesday) and 2/21/24 (Wednesday) are both 2/26/2024 (Monday)?

    Do your weekends not fall on Saturdays and Sundays?

  14. #14
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: 20 days - Return Date from the Calendar days

    Hi
    If u count from 2/20 then 2/21, 2/22, 2/23, 2/24, 2/25 then its 2/25 but because 2/25 is sunday then i want to fall on 2/26

    now
    count from 2/21 then 2/22, 2/23, 2/24, 2/25, 2/26 so it is 2/26 because is a good weekday.

    I want 5 dates to fall on weekdays not weekends or the dates thatbis located in sheet2.

  15. #15
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: 20 days - Return Date from the Calendar days

    This is my last attempt at answering you:

    Return Date.png

  16. #16
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: 20 days - Return Date from the Calendar days

    As mention in mypost #5, (End Date) - 1 then +1 may help the result fall out of WK/HOL

    Please Login or Register  to view this content.

  17. #17
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: 20 days - Return Date from the Calendar days

    Sorry to say, Quang, your formula is not foolproof - please see attached workbook.

    DATERETURN JT.png
    Attached Files Attached Files

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,836

    Re: 20 days - Return Date from the Calendar days

    Can you to modify the code.
    It's a FORMULA, not code, so I've moved the thread out of the VBA section and into the Formulas & Functions section.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  19. #19
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: 20 days - Return Date from the Calendar days

    Quote Originally Posted by RJ1969 View Post
    Hi
    If u count from 2/20 then 2/21, 2/22, 2/23, 2/24, 2/25 then its 2/25 but because 2/25 is sunday then i want to fall on 2/26
    now
    count from 2/21 then 2/22, 2/23, 2/24, 2/25, 2/26 so it is 2/26 because is a good weekday.
    I want 5 dates to fall on weekdays not weekends or the dates thatbis located in sheet2.
    Quote Originally Posted by RJ1969 View Post
    Hello everyone,
    5 Calendar day from 2/20/24 iis 2/26/2024
    5 calendar day from 2/21/24 is 2/26/2024
    5 caelndar day from 2/22/24 is 2/27/2024
    5 calendar day from 2/23/24 is 2/28/2024
    Quote Originally Posted by josephteh View Post
    Sorry to say, Quang, your formula is not foolproof - please see attached workbook.
    Hi JT, I notice that the OP doesn't mention wanting to work 5 consecutive days, starting from a specific day; rather, they want to work 5 calendar days in total. However, if the end date falls on a weekend or holiday, it will be adjusted to the next weekday.
    That is what my formula did

  20. #20
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    20 days - Return Date from the Calendar days

    Hello,
    Haven't resolved this issue yet.
    I need a formula that if I enter date in E3 the result should show (see below).

    5 calendar days from 02/20/24 is 02/26/24

    5 Calendar days from 02/21/24 is 02/26/24

    5 Calendar days from 02/22/24 is 02/27/24

    5 Calendar days from 02/23/24 is 02/28/24


    Sheet2 is the dates our office are closed.

    At the attachment worksheet if I enter 02/20 result is 02/26/24 which is correct.
    But if I enter 02/21/24 is 02/27/24 is incorrect and if I enter 02/22 result is 02/28/24 is also incorrect.

    I need the formula where all the dates should be resulted as I wished for.

    Thank you
    Attached Files Attached Files

  21. #21
    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,445

    Re: Calendar date 5 days

    Not sure I understand your logic. Why can't you just use:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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


  22. #22
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Calendar date 5 days

    I think your expected answer for the 20th is incorrect. Please explain WHY you think it should be the 26th.

    Try:

    =WORKDAY.INTL(E3,5,"0000000",Sheet2!$A$1:$A$42)
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  23. #23
    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,445

    Re: Calendar date 5 days

    @Glenn: RETURN DATE 5 DAYS CALENDAR DATE INCLUDING WEEKENDS is specified in the sample file.

  24. #24
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: Calendar date 5 days

    Trevor, I don't follow you. In any event, I'm away out now for dinner and a beer.

  25. #25
    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,445

    Re: Calendar date 5 days

    Not sure I do. A bit confusing. Enjoy!

  26. #26
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Calendar date 5 days

    Hi

    Still not working as it supposed to have a result.
    Ok... let me try.
    If I enter 02/20/24 in E3, if you count start from 21,22,23,24,25 the 5 count day 02/25/24 but since 02/25/24 is not a good because its Sunday (our office closed on weekend) then the result should show 02/26/24.

    Now, If I enter 02/21/24, if you count start from 22,23,24,25,26 the 5th day count is 02/26/24 it's a good day because our office is open.

    Lastly, if I enter 02/14/24, if you start counting from 15,16,17,18,19 the 5 days calendar is the 19th but since the 19th is holiday (I have the office holiday in Sheet2) then it should follow the next day the 02/20/24.

    I hope I explain very clearly.



    5 calendar days from 02/20/24 is 02/26/24

    5 Calendar days from 02/21/24 is 02/26/24

    5 Calendar days from 02/22/24 is 02/27/24

    5 Calendar days from 02/144/24 is 02/20/24

  27. #27
    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,445

    Re: Calendar date 5 days

    How can you count 2/25/24 in the first calculation but not the second? It's still not a working day.

  28. #28
    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,445

    Re: Calendar date 5 days

    I think Glenn's formula should be:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  29. #29
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Calendar date 5 days

    Hi TMS
    Please Login or Register  to view this content.
    So I tried this formula and replaced Glenn's formula but I still not getting the result that I wish for.

    In my worksheet I sent there is a calendar.
    Try to enter 02/21/24 and start counting from Feb. 22,23,24,25,26 the 5th day is 02/26/24 which is a good day. Our office is closed on weekends and holidays(Sheet2).

    I hope I explained clearly.

  30. #30
    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,445

    Re: Calendar date 5 days

    I hope I explained clearly.
    No, not really. If your office is closed on the Sunday ( 02/25/24 ), you need to exclude it from all the calculations, not just the first one. It's not a working day, regardless of whether or not the count lands on it.

  31. #31
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Calendar date 5 days

    Hi
    The weekends and Holidays(Sheet2), yes it should be excluded but its included in counting the days.

  32. #32
    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,445

    Re: Calendar date 5 days

    How can it be excluded but included in counting the days? It doesn’t make any sense to me, so I’m going to take a step back and let someone else have a go.

  33. #33
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Calendar date 5 days

    What I meant is that when we count days from the day we start, we do include counting the weekends and holidays. But if it falls the 5th day on weekends or holidays then we have to use the following weekday.

    Thanks

  34. #34
    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,445

    Re: Calendar date 5 days

    Ok, I think I understand. Not sure how to get what you want.

  35. #35
    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,445

    Re: Calendar date 5 days

    Maybe this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Goodnight

  36. #36
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: Calendar date 5 days

    TMS

    ok... I tried it and it worked but I Tried to enter 2/13/24 and it appears 02/19/24 (Holiday - Sheet2) supposedly 02/20/22. Tried to enter 04/15/24 and it appears 04/20/24 (Saturday) it supposed to appear 04/22/24. But some of the days appears ok. You can try to enter in the sample worksheet I sent previously and you will see what it does.

    thanks

  37. #37
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Calendar date 5 days

    I remember I addressed this issue in your previous topic, post number 16. Pls come back to read my clarification carefully.

    https://www.excelforum.com/excel-for...ml#post5935841

    However, I haven't heard back from you since then. When I retested that configuration, the results came back as you desired.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  38. #38
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: 20 days - Return Date from the Calendar days

    Hi Bebo
    The formula is not giving the result as i want it.

    TMS formula is actually guving me the way I want it except the 2/14 and and 4/15 entry that still giving me the saturday and holiday result as I noticed when I did an entry on those dates.

    thank you

  39. #39
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: 20 days - Return Date from the Calendar days

    Quote Originally Posted by RJ1969 View Post
    What I meant is that when we count days from the day we start, we do include counting the weekends and holidays. But if it falls the 5th day on weekends or holidays then we have to use the following weekday.

    Thanks
    Based on this logic, Bebo's formula should work.
    Last edited by josephteh; 04-13-2024 at 11:16 AM.

  40. #40
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,059

    Re: 20 days - Return Date from the Calendar days

    If it doesn't work on certain dates, tell us what is the expected result.
    Last edited by josephteh; 04-13-2024 at 12:18 PM.

  41. #41
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: 20 days - Return Date from the Calendar days

    Hi Bebo,
    I apologize. Your formula works perfect! I am not sure what happened because when I tried it did not work before. But I gave it a try and it worked perfect. Thank you so much.

    Can I request just very last thing. This will work for the other worksheet. I have two worksheet I am working on. One worksheet has been resolved with your formula.

    My other worksheet it's pretty much the same but if falls Monday-Thursday, I want the result to be the following Friday.
    example: 04/15/24 result is 04/22/24 (on your code) then the following Friday is 04/26/24. In otherwords, anything tha will falls on M-Thursday then it should be Friday. But if falls Friday (Holiday) then the good following Friday. I think there is a Friday that is holiday in sheet2

    I am not sure if this will be possible.

    Please Login or Register  to view this content.
    Last edited by RJ1969; 04-13-2024 at 09:27 PM.

  42. #42
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: 20 days - Return Date from the Calendar days

    Since Bebo resolved my first issue about the formula, Should I place this second issue to a different post?

  43. #43
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: 20 days - Return Date from the Calendar days

    Try this:

    Please Login or Register  to view this content.
    With only Friday (0) is working day

  44. #44
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: 20 days - Return Date from the Calendar days

    Hi Bebo

    It showed #NAME? after I put this formula =WORKDAY.INTL(E3+5-1,1,"1111011",Sheet2!$A:$A)
    Attached Files Attached Files

  45. #45
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: 20 days - Return Date from the Calendar days

    It still works for me.
    Try to refresh the spreadsheet (Hit F9) then it should works.
    Attached Images Attached Images

  46. #46
    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,445

    Re: 20 days - Return Date from the Calendar days

    According to the MS web page for WORKDAY.INTL, it is not available in Excel 2010.

    See: https://support.microsoft.com/en-us/...9-39611a9bf81d

  47. #47
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: 20 days - Return Date from the Calendar days

    Quote Originally Posted by TMS View Post
    According to the MS web page for WORKDAY.INTL, it is not available in Excel 2010.

    See: https://support.microsoft.com/en-us/...9-39611a9bf81d
    TMS, thank you for your comment, it's true that WORKDAY.INTL isn't available in Excel 2010.
    @RJ1969
    in that case, using a UDF is also a good choice.

    PHP Code: 
    Option Explicit
    Function Fri(cell As Doublenum As Integer) As Date
    Dim i
    &, n&, m&, c&, dat As Datedat2 As Date
    dat 
    cell num
    = Array(5432106)(Weekday(dat) - 1)
    dat dat m
    WorksheetFunction.CountIf(Worksheets("Sheet2").Columns(1), dat)
    If 
    0 Then
        Fri 
    dat
    Else
        Do
            
    1
            Fri 
    dat 7
            
    If Weekday(Fri) = 6 Then Exit Function
        
    Loop Until i 100
    End 
    If
    End Function 
    Attached Files Attached Files

  48. #48
    Forum Contributor
    Join Date
    10-05-2014
    Location
    CALIFORNIA
    MS-Off Ver
    2010
    Posts
    1,719

    Re: 20 days - Return Date from the Calendar days

    Wow! Perfect. Thank you Bebo and TMS and to the rest.

    I appreciated.

  49. #49
    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,445

    Re: 20 days - Return Date from the Calendar days

    You're welcome.



    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  50. #50
    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,445

    Re: 20 days - Return Date from the Calendar days

    Thanks for the rep.

+ 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] Return the next working day taking in consideration the days off on a 2 days interval
    By PaulM100 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-04-2020, 01:58 AM
  2. Replies: 6
    Last Post: 10-09-2019, 01:18 PM
  3. [SOLVED] Formula to calculate working days and calendar days per month-year ?
    By donny007 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-05-2018, 06:23 PM
  4. Disable past days and give days a colour in a Calendar
    By Malor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2018, 07:33 AM
  5. [SOLVED] How can I calculate workday date when only have calendar days?
    By Tooley in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-03-2017, 09:31 AM
  6. [SOLVED] Number of Days Between Dates but if no Date go to next and return # of Days
    By Bikeman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-14-2012, 12:02 PM
  7. Calendar days from start date and workdays
    By mcinnes01 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2010, 10:04 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