+ Reply to Thread
Results 1 to 12 of 12

Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

  1. #1
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Cool Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

    Hello,

    I have requested my question HERE where I got the solution but the requirement is change now.

    Now I need to calculate Years, Months, Week, Days, Hours, Minutes & Seconds.

    For example: I have Receiving Date in A1 as 18-07-2019 8:00:00 AM and response/finishing date in B1 as 25-07-2019 4:30:50 PM. So the result will be in C1 as 01 Weeks, 01 days, 08 hours, 30 minutes and 50 Seconds.

    Above example is for only 1 week and 1 day. so possibly we need to have other output as I mentioned above.

    I hope my explanation is understandable.

  2. #2
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

    Easiest formula to understand would be:

    Please Login or Register  to view this content.
    Click the * to say thanks.

  3. #3
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

    Thanks Paul for responding on my request.

    The challenge is formula not to calculate weekends which 2 days in a week starting from Friday and ending Saturday.

    Example 1:

    Start Date:18-07-2018 08:00:00 AM End Date: 25-07-2019 04:30:50 PM
    Actual result should be 01 Weeks, 01 days, 08 hours, 30 minutes and 50 Seconds but your formula giving 1 Weeks, 7 days, 8 Hours, 30 Minutes, 50 Seconds


    Example 2:
    Start Date:07-07-2019 08:00:00 AM End Date: 25-07-2019 04:10:05 PM
    Actual result should be 03 Weeks, 00 days, 08 Hours 30 Minutes and 50 Second but your formula giving 2.57142857142857 Weeks, 18 days, 8 Hours, 10 Minutes, 5 Seconds



    The formula must calculate differences with the following.
    1. Excluding weekends which is Friday and Saturday.
    2. If days exceeding weeks (5 working days) then convert into days means 1 week 2 days if Start date is 14-07-2019 and End Date is 22-07-2019

  4. #4
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

    Maybe this one?
    Please Login or Register  to view this content.
    Based on etaf solution in your previous post

  5. #5
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

    Dear Paul,

    Kindly see the image below.

    The 3rd date is having 3 weeks but your formula is calculating 2.57 weeks. Also the 4th Weeks. if the days more than 5 then I assumed as week.

    Can you help me on this please.

    sss.jpg

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

    Re: Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

    This modification of Paul's formula (based on etaf's solution) yields the expected (manual) results in weeks and days (although there is some discrepancy in hours and seconds for row 5):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    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.

  7. #7
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

    Guys,

    We need to change in the formula.

    Hours required some calculation as per my boss sorry.

    the requirement is if the working hours is more than 8 then it will be consider as 1 day. Calculation will be for 8 hours only not for 24 hours.

    Can it be possible please.

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

    Re: Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

    Will be easier to determine if it is possible if you will upload a sample .xlsx file that shows the expected outcomes.
    Let us know if you have any questions.

  9. #9
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

    Hai JeteMc,

    As per your request I am attaching a sample file. Sorry to respond as I am preparing sample.

    Everything is ok with the formula. The only calculation we need to add here is converting more than 8 hours into days as the shift is for 8 working hours.

    222222222.jpg
    Attached Files Attached Files

  10. #10
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

    Please try at C2

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

  11. #11
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

    Hai Bo_Ry,

    Appreciate your response on my above request.

    It is working as we want. Let me check with my team is this they want and get back to your with feedback. as we are in holidays for a week so I will response to you after next week i.e. 18-08-2019.

    Thanks once again.

  12. #12
    Valued Forum Contributor
    Join Date
    01-11-2012
    Location
    Riyadh, K.S.A.
    MS-Off Ver
    Windows 11 with Excel 2013 & 2016
    Posts
    900

    Re: Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates

    Sorry for responding late.

    Topic marked as solved and reputation add to all users.

+ 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: 5
    Last Post: 10-21-2017, 10:26 AM
  2. Convert a value to Years, Months, Days, Hours and Minutes
    By )3az_)3aziah in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-30-2017, 11:18 AM
  3. [SOLVED] Formula for calculating years and days, excluding months, between two dates
    By jchollick in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-04-2017, 09:44 AM
  4. Convert Work Hours, Days or Work Week to Months
    By mycon73 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-25-2014, 09:04 AM
  5. Calculating years/months/days between two dates
    By jen9537 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-05-2014, 03:03 AM
  6. Convert days -> Years, Months, Days, Hours, Minutes, Seconds
    By brharrii in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-06-2012, 06:44 PM
  7. Replies: 2
    Last Post: 01-24-2012, 09:20 PM

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