+ Reply to Thread
Results 1 to 5 of 5

Convert Numbers to Time (Day, Hours, Minutes & Seconds)

  1. #1
    Forum Contributor
    Join Date
    04-18-2016
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    178

    Smile Convert Numbers to Time (Day, Hours, Minutes & Seconds)

    Hello Team,

    How to convert the numerical value to time format.
    I'm extracting the data from servicenow application to excel sheet, where the values are shown in numbers instead of time format.

    I have numeric value in A2 (792134) which needs to be shown as 9 Days 4 Hours 2 Minutes

    Thanks & Regards,
    Gem

  2. #2
    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,101

    Re: Convert Numbers to Time (Day, Hours, Minutes & Seconds)

    One way:

    =INT(A2/86400)&" days "&INT(MOD(A2,86400)/3600)&" hours "&INT(MOD(MOD(A2,86400),3600)/60)&" minutes"
    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

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,452

    Re: Convert Numbers to Time (Day, Hours, Minutes & Seconds)

    This one is also funny
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Alternatively you could use =A1/(24*60*60) and use the second part as custom format
    Attached Files Attached Files
    Last edited by Pepe Le Mokko; 04-01-2022 at 04:32 AM.

  4. #4
    Forum Contributor
    Join Date
    04-18-2016
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    178

    Re: Convert Numbers to Time (Day, Hours, Minutes & Seconds)

    Thank you so much Glenn & Pepe..

  5. #5
    Valued Forum Contributor
    Join Date
    07-23-2013
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    988

    Re: Convert Numbers to Time (Day, Hours, Minutes & Seconds)

    Excel stores dates and times as numeric values, where 1 is a day (so 0.5 is 12 hours, etc). Your data is in seconds, so you need to divide that by 86400 (or 24*60*60) to convert it to days. Then it depends whether you want to have the actual value in the cell as your string, in which case Glenn's solution looks nice to me.

    If you just want it to be displayed as you have said, but retain the actual date value so you can use it with other formulae easily, you can instead just use A1/86400 and use a custom format of:

    d "Days" h "Hours" m "Minutes"

    This however has the drawback that if you have over 31 days then it will go back to 1, so if that's possible in your data then it's not a great solution. I can't figure out how to resolve this. Looking around on Google it might not be possible with formatting only. Someone else might be able to say for sure.

    NB You can do it with hours and minutes only, e.g.

    [h] "Hours" m "Minutes"

    will give "220 Hours 2 Minutes" in your example, but you can't do the same for days.

+ 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] Convert time of day format to hours,minutes and seconds like a timer/stopwatch
    By mutzie in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-05-2019, 07:58 PM
  3. convert days hours minutes seconds to just minutes
    By hollylynn in forum Excel General
    Replies: 4
    Last Post: 08-28-2015, 08:53 AM
  4. Convert Days:Hours:Minutes:seconds to minutes.
    By Kevingardner1 in forum Excel General
    Replies: 4
    Last Post: 06-03-2014, 06:44 PM
  5. Replies: 2
    Last Post: 07-19-2012, 12:48 PM
  6. convert from seconds to form hours: minutes: seconds?
    By nguyen_han in forum Excel General
    Replies: 2
    Last Post: 10-13-2011, 06:56 AM
  7. Replies: 7
    Last Post: 05-08-2005, 04:06 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