+ Reply to Thread
Results 1 to 8 of 8

Date time separation & calculation to get to total hh:mm

  1. #1
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Date time separation & calculation to get to total hh:mm

    Hi, this nur again,
    Cell A1 having date & time format like 20130307141900 . here the actual meaning is yyyymmddhhmmss
    From here I want to separate date & time , which is like below
    my first date time format like below, from here i want CELL B & CELL C as output results
    Please Login or Register  to view this content.
    my second date time is another format, cell D & cell E is input data , from here i want like cell F & cell G
    Please Login or Register  to view this content.
    3rd step:
    After getting above format now I want to subtract from one date to other date to get the total hour & minute. Subtract will be from
    Please Login or Register  to view this content.
    Last edited by nur2544; 03-08-2013 at 01:35 PM.

  2. #2
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Date time separation & calculation to get to total hh:mm

    Hi nur2544

    To parse out the date and time, assuming in A1: 20130307141900
    In B1: =DATE(LEFT(A1,4),MID(A1,5,2),MID(A1,7,2))
    In C1: =TIME(MID(A1,9,2),MID(A1,11,2),RIGHT(A1,2))

    Then you can subtract, add etc or whatever you want to do.
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Date time separation & calculation to get to total hh:mm

    Hi Nur,

    See the attached file where I used Date / Time function with text functions like left / mid / right to obtain your desired results :-

    date time separation.xlsx

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  4. #4
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Re: Date time separation & calculation to get to total hh:mm

    Hi,DILIP thanks for replay. you are all most correct 99.99% . the time function is giving correct results. but date subtraction is not working properly
    reff: to your workbook
    Please Login or Register  to view this content.
    but the problem is that if one day previous then 24 hours should reflected
    then the results should be 24 hours and 06 minutes or 24:06 (i am not sure, is it correct format or not ). if two days before then it should be
    48 hours and 06 minute as i kept or assume the time is same only day is change, hope got the point..

  5. #5
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Re: Date time separation & calculation to get to total hh:mm

    Hi, Kevin UK,
    your first step of my issue is correct , but I am very much worried about subtract as my date & time Now separated into four cell , if it is in the two cell then I can easily subtraction from once cell to other cell, to get total hour & time of outage

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Date time separation & calculation to get to total hh:mm

    Hi Nur2544,

    Formula is correct, just change the format to [h]:mm


    Regards,
    DILIPandey
    <click on below * if this helps>

  7. #7
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Re: Date time separation & calculation to get to total hh:mm

    Hi DILIP,
    Formula is correct, just change the format to [h]:mm
    you did excellent job for me ,now my desired results is 100 % correct.thanks for giving your valuable time regarding this issue. take care..

  8. #8
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Date time separation & calculation to get to total hh:mm

    you are welcome Nur2544.... cheers


    Regards,
    DILIPandey
    <click on below * if this helps>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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