+ Reply to Thread
Results 1 to 16 of 16

Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

  1. #1
    Registered User
    Join Date
    12-06-2021
    Location
    United Kingdom
    MS-Off Ver
    Office365
    Posts
    7

    Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

    Good day all,

    I am hoping to get some help with a formulae. I am a complete novice, and have managed to find formulae online which allow me to calculate YMWDHMs from a large number of minutes, however, I cannot seem to find anything which would help me tweak the formula to report back in the same format when considering a working day is 8 hours, and a working week is 5 days. Can anyone help with this specific issue? And to add to this, I would also like the result to ignore the specific units when there is a zero value.

    This started out as something I figured was going to be relatively simple and has mutated into the foul spawn of something wretched and putrid.

    Any assistance would be gratefully received.

    Thanks
    Last edited by shadow2351jl; 12-06-2021 at 12:16 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,081

    Re: Calculating Years, Months, Weeks, Days, Hours, Minutes for Work Days/Hour from Minutes

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-06-2021
    Location
    United Kingdom
    MS-Off Ver
    Office365
    Posts
    7

    Re: Calculating Years, Months, Weeks, Days, Hours, Minutes for Work Days/Hour from Minutes

    Please find a sample sheet attached. Thanks
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,142

    Re: Calculating Years, Months, Weeks, Days, Hours, Minutes for Work Days/Hour from Minutes

    correction so others are not misled, your system does NOT calculate W (weeks).. it does however calculate YMDHM.

  5. #5
    Registered User
    Join Date
    12-06-2021
    Location
    United Kingdom
    MS-Off Ver
    Office365
    Posts
    7

    Re: Calculating Years, Months, Weeks, Days, Hours, Minutes for Work Days/Hour from Minutes

    Thank you, Title updated.
    Last edited by AliGW; 01-07-2022 at 06:45 AM. Reason: PLEASE don't quote unnecessarily!

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,039

    Re: Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

    Try the following in cells H3 and down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Although untested, I imagine that substituting M3 for L3 will yield the desired results for cells I3 and down.
    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
    Registered User
    Join Date
    12-06-2021
    Location
    United Kingdom
    MS-Off Ver
    Office365
    Posts
    7

    Re: Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

    Firstly, Happy New Year all,

    Secondly, many thanks for this. And while it does give YMDHM values, it does this for conventional weeks, whereas I was looking for an 8 hour work day and 40 hour work week. I imagine this would be a considerably different number if calculated to these parameters. I simply do not have the wherewithal to figure this out so any additional help would be wholeheartedly appreciated.

    Thanks again
    Last edited by AliGW; 01-07-2022 at 06:44 AM. Reason: PLEASE don't quote unnecessarily!

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,039

    Re: Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

    I had assumed that the YMDHM values shown in columns H:I were basically correct and that you only wanted the zero value units removed.
    I now assume that you want H4 to read 1 Days 1 Minute(s), and H6 to read 1 Days 1 Hours 37 Minute(s) is that correct?

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,039

    Re: Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

    Based on my assumption, here is a proposal that employs a lot of helper columns (N:W).
    The columns marked *(adj) for minutes, hours, days, weeks, months and years are the final calculations for those units.
    For example the final calculation for Day is: =IF(Q3>=28,Q3-28,IF(Q3>=21,Q3-21,IF(Q3>=14,Q3-14,IF(Q3>=7,Q3-7,Q3))))
    Such that if there are 23 days in the (raw) calculation, then the final number of days will be 2 and 3 will be added to the number of weeks.
    Column H is populated using: =IF(W3=0,"",W3&" Year(s)")&IF(V3=0,""," "&V3&" Month(s)")&IF(T3=0,""," "&T3&" Week(s)")&IF(R3=0,""," "&R3&" Day(s)")&IF(P3=0,""," "&P3&" Hour(s)")&IF(N3=0,""," "&N3&" Minute(s)")
    Note that I have only tested with the values present in the file that was attached to post #3, so I encourage rigorous testing to find any errors.
    Note that I have only worked this out for the Total Sample Time (Conventional). To get the Total Sample Time (New) a new set of helper columns would be needed where references to column L are changed to column M
    Let us know if you have any questions.

  10. #10
    Registered User
    Join Date
    12-06-2021
    Location
    United Kingdom
    MS-Off Ver
    Office365
    Posts
    7

    Re: Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

    I was just coming back to respond with the affirmative to your previous questions, and see that you've knocked it out the park already. Many thanks, there are no words to express my appreciation.

    Regards
    Last edited by AliGW; 01-07-2022 at 06:45 AM. Reason: PLEASE don't quote unnecessarily!

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,081

    Re: Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

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

    Also, if you have not already done so, 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 all those who offered help.

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,039

    Re: Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

  13. #13
    Registered User
    Join Date
    12-06-2021
    Location
    United Kingdom
    MS-Off Ver
    Office365
    Posts
    7

    Re: Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

    Apologies to JeteMc, I did notice a small issue with the solution. Although the formula seems to work with the smaller values, when it starts getting up into the weeks, months, and years, it seems to fall over.

    In row 6, if we multiply cell F6 by 10, so 20 mins instead of 2 mins, we'd expect an increase in the time H6 by 10, however, this is not the case. Add to that, if working with work hours and work weeks, H7 would not be 6 years..... as that is calculated using 24 hour days/7 day weeks.

    Could I possibly trouble y'all a tad further for help on this?

    Appreciated.

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,039

    Re: Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

    As to row 6 if when 2 is changed to 20 in F6 then the value in L6 increases by a factor of 10 so I believe the value in H6 is correct.
    As to row 7 I changed the formula for Week(raw) to read: =(Q3-R3)/5, the Day(raw) formula already reads: =SUM(FLOOR(30.5*MOD(L3*12,1),1),(O3-P3)/8) so I believe that the calculation is now made based on 8 hours/day and 5 days/week.
    Admittedly calculations are based on the original formula in column H of the file attached to post #3, so if that formula was not correct then mine will not be either.
    We may be in a better position to help if we were provided some manually calculated results with which to compare the yields of our proposed formulas.
    Let us know if you have any questions.

  15. #15
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

    I was looking for an 8 hour work day and 40 hour work week.
    How many hours for 1 month. is it 30 days (30*8 hrs) or 4 weeks (4*5*8 hrs).
    Similarly For 1 year. Is It 365 days or 12 months.
    Pl clarify.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  16. #16
    Registered User
    Join Date
    12-06-2021
    Location
    United Kingdom
    MS-Off Ver
    Office365
    Posts
    7

    Re: Calculating Years, Months, Days, Hours, Minutes for Work Days/Hour from Minutes

    Thank you for reaching out, and to JeteMc.

    For the hours in one month, I would say the 4*5*8 hrs.
    The year would be 12 months, or more accurately 52 weeks * (5 days * 8 hrs) if that makes sense.

    Hope this clarifies.

    Regards

    Shads
    Last edited by AliGW; 01-14-2022 at 06:50 AM. Reason: PLEASE don't quote unnecessarily!

+ 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] Convert seconds to years, months, days, hours, minutes snd seconds
    By Tresfjording in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-14-2022, 12:55 AM
  2. [SOLVED] Calculating Years, Months, Week, Days, Hours, Minutes for Work Days between two dates
    By hecgroups in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-23-2019, 12:09 AM
  3. Replies: 5
    Last Post: 10-21-2017, 10:26 AM
  4. 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
  5. help needed with calculating days from hour/minutes
    By KatWat in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-06-2015, 11:00 AM
  6. [SOLVED] Function or macro to convert string with weeks, days, hours, minutes to Hours
    By kknb0800 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2012, 11:35 AM
  7. 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

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