+ Reply to Thread
Results 1 to 10 of 10

Calculating Dates

  1. #1
    Registered User
    Join Date
    01-06-2019
    Location
    Houston, Texas
    MS-Off Ver
    2016
    Posts
    4

    Calculating Dates

    I am starting with a completion date and using formulas to calculate deadline dates based off of the completion date. My issue is that if a calculated date lands on a Saturday or Sunday, how to I have it revert to the Friday before the Saturday or Sunday?

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Calculating Dates

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    01-06-2019
    Location
    Houston, Texas
    MS-Off Ver
    2016
    Posts
    4

    Re: Calculating Dates

    I have attached a copy of the workbook

    thank you!
    Attached Files Attached Files

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Calculating Dates

    in J8

    =IF(WEEKDAY(G8)=1,G8-2,IF(WEEKDAY(G8)=7,WEEKDAY(G8)-1,G8))

    and copy down
    Last edited by alansidman; 01-06-2019 at 09:06 PM.

  5. #5
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    484

    Re: Calculating Dates

    Try wrapping your existing formulas in column G and in range B36:B43 in a WORKDAY(your_formula +1,-1) function.

    For example, your formula in cell G32 (currently, =C33-3) would become =WORKDAY(C33-3+1,-1)

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Calculating Dates

    Another option...
    =IF(G8="","",IF(WEEKDAY(G8,2)>5,G8-WEEKDAY(G8,2)+5,G8))
    format as long date, then copy down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Registered User
    Join Date
    01-06-2019
    Location
    Houston, Texas
    MS-Off Ver
    2016
    Posts
    4

    Re: Calculating Dates

    thank you for all the assistance, now I have more question. I need to take a date and then add 20 days to it, if that day is a Monday, then the date stands, if the new calculated date is any other date, I need it to go to the following Monday. For reference on the attached spreadsheet is is C7.

  8. #8
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    484

    Re: Calculating Dates

    Is this what you need in cell G7?

    =WORKDAY.INTL(G6+20-1,1,"0111111")

  9. #9
    Registered User
    Join Date
    01-06-2019
    Location
    Houston, Texas
    MS-Off Ver
    2016
    Posts
    4

    Re: Calculating Dates

    the above calculation worked in all but two cells. For some reason two of the cells go to a date in 1900 and I am not sure why. I copied the formula from the direct cell above, i am not sure what the issue is?

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,535

    Re: Calculating Dates

    Pasting the formula into row 6 and dragging down it yields a result of Monday Jan 23, 1900 if the corresponding cell in column G is blank. Other than that the dates are in 2019 and seem to be correct. Please let us know which cells are displaying incorrect dates or, better yet, upload another sample showing where the issue is occurring.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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: 1
    Last Post: 09-23-2018, 09:29 PM
  2. Formula calculating start/end dates using today and Blank if no dates
    By Italstal33 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-29-2017, 05:17 AM
  3. [SOLVED] Calculating a future dates based on dates or birth.
    By CDobby in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 07-31-2012, 11:22 AM
  4. Calculating Eligibility Dates & Hiding negative Dates
    By Dooger in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-14-2012, 04:01 PM
  5. calculating the # of days btwn 2 dates INCLUDING the dates
    By jfarlow in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-18-2008, 12:27 PM
  6. Replies: 4
    Last Post: 10-31-2005, 05:05 AM
  7. Replies: 5
    Last Post: 10-26-2005, 02:05 PM

Tags for this Thread

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