+ Reply to Thread
Results 1 to 3 of 3

calculating date

  1. #1
    Registered User
    Join Date
    11-14-2009
    Location
    bangalore
    MS-Off Ver
    Excel 2003
    Posts
    1

    calculating date

    I have 2 columns with dates in the following format,

    dd-mm-yyyy hh:mm:ss:sss

    A2 = 10-10-2009 10:06:06:100
    B2 = 10-10-2009 10:06:06:101

    I want B2-A2 in C2

    I tried using =B2-A2 in C2 column. I am not getting the expected value.

    Expected value,

    00-00-0000 00:00:00:001

    Thanks

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: calculating date

    surely the format should be
    dd/mm/yyyy hh:mm:ss.000
    then subtracting one from the other will give
    00/01/1900 00:00:00.001
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: calculating date

    If your values are as you say they are, and assuming you can not alter them, you can use:

    C2: =SUBSTITUTE(B2,":",".",3)-SUBSTITUTE(A2,":",".",3)

    I would suggest formatting C2 as: [hh]:mm:ss.000

+ 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