subtracting dates in excel... help please!

Discussion in 'General Software' started by Mizugori, Aug 11, 2010.

  1. Mizugori

    Mizugori [H]ard|Gawd

    Messages:
    1,229
    Joined:
    Mar 25, 2004
    I am trying to subtract two dates in excel but I keep getting weird results...

    My dates are formatted like this: 8/11/2010

    I am using TODAY() to return the current date. Then I want to compare that to see how many days have passed since a given date. So my formula is this: =TODAY()-D2

    Now, it seems to kind of work because the result I get is 1/30/1911. 30 days is the correct answer! But why am I getting the full date?? How can I fix this? And why the heck is it saying 1911 - on another computer I tried it says 1/30/1900...

    ??
     
  2. KevinO

    KevinO [H]ard|Gawd

    Messages:
    1,434
    Joined:
    Aug 6, 2004
    Look into the Datediff function. I think for what you want (doing this from the top of my head) is Datediff("d", D2, TODAY()) or you can sub TODAY() for NOW(). Like I said it is from the top of my head but should be something like that.
     
  3. Mizugori

    Mizugori [H]ard|Gawd

    Messages:
    1,229
    Joined:
    Mar 25, 2004
    it gives the same results, already tried it
     
  4. PTNL

    PTNL [H]ardness Supreme

    Messages:
    4,190
    Joined:
    Jan 2, 2005
    Post your current Excel formula, along with various iterations of what you've tried after your first post.