+ Reply to Thread
Results 1 to 5 of 5

I need to add time in the format of 00d 00:00:00

  1. #1
    Registered User
    Join Date
    10-19-2017
    Location
    SLC, Utah
    MS-Off Ver
    2013/2016
    Posts
    1

    I need to add time in the format of 00d 00:00:00

    I have tried various formulas to be able to add I am pulling from a MySQL database and pasting into an Excel Spreadsheets. The time appears as 00d 00:00:00. Is there any way I can add this into an Excel Cell and come up with a added Sum for say says D2 through D20?

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: I need to add time in the format of 00d 00:00:00

    You'll need to convert it to Excel's time format. Assuming you have that text string in A1, this formula will convert it:
    =LEFT(A1,2)+MID(A1,5,2)/24+MID(A1,8,2)/(24*60)+MID(A1,11,2)/(24*60*60)

    Do that for each string and then you can add up the numbers to get a total. 'Reverse' the formula if you need to get the sum back into the MySQL format.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: I need to add time in the format of 00d 00:00:00

    First, verify that D2:D20 contain text, not numeric time. For example, does =ISTEXT(D2) return TRUE?

    If so, then ostensibly:

    Please Login or Register  to view this content.
    If we can assume that d, h, m and s are always 2 digits as you indicated, we can simplify:

    Please Login or Register  to view this content.
    Of course, the sum of the days might no longer be limited to 2 digits.

  4. #4
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: I need to add time in the format of 00d 00:00:00

    Quote Originally Posted by joeu2004 View Post
    Please Login or Register  to view this content.
    That's silly; left over from an earlier and unnecessarily-complicated thought. It should be:

    Please Login or Register  to view this content.
    And again, that is necessary only if we cannot assume that d, h, m and s are always 2 digits, as you indicted they are.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: I need to add time in the format of 00d 00:00:00

    Another way:

    D
    E
    2
    11d 08:44:11
    3
    2d 12:35:49
    4
    5d 18:24:38
    5
    15d 01:17:03
    6
    15d 14:13:08
    7
    6d 11:14:56
    8
    7d 07:09:21
    9
    8d 14:56:41
    10
    4d 15:32:52
    11
    13d 06:19:52
    12
    9d 06:42:15
    13
    3d 19:54:55
    14
    2d 19:47:26
    15
    7d 14:08:24
    16
    12d 23:39:58
    17
    6d 21:51:47
    18
    9d 05:26:41
    19
    14d 16:40:58
    20
    8d 23:31:12
    21
    166.925081
    D21: {=SUM(--LEFT(D2:D20, FIND("d", D2:D20) - 1), --RIGHT(D2:D20, 8))}
    22
    166d 22:12:07
    D22: =INT(D21) & "d " & TEXT(D21, "hh:mm:ss")
    Entia non sunt multiplicanda sine necessitate

+ 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. VBA calculate sleep time, when time is entered in military time format
    By axm1955 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-29-2017, 10:28 AM
  2. [SOLVED] time sheet help, format TIME and formula based on the actual time entered.
    By bh mng in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-06-2016, 01:10 PM
  3. Format time from military time to standard time
    By Valencia0307 in forum Excel General
    Replies: 7
    Last Post: 06-01-2014, 11:15 AM
  4. Change format of lots of data cell to a time format
    By dazza67 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-24-2013, 03:24 PM
  5. Convert date and time in serial number format to text format
    By nda13112 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-11-2013, 02:45 PM
  6. Excel: How to convert time format into number format that can be added?
    By Frances Jones in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-17-2012, 04:10 PM
  7. Display time in time format instead of decimal format
    By CasualVisitor in forum Excel General
    Replies: 5
    Last Post: 07-03-2009, 06:24 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