Excel Help

Discussion in 'General Software' started by [AFX]Northy, Dec 3, 2019.

  1. [AFX]Northy

    [AFX]Northy Member

    Joined:
    Sep 24, 2003
    Messages:
    1,143
    Location:
    Brisbane
    I am trying to work out how to calculate the amount of days between 2 dates in an excel sheet. The format is like below,

    upload_2019-12-3_17-31-22.png
     
  2. NanoDuke

    NanoDuke Member

    Joined:
    Feb 4, 2007
    Messages:
    7,630
    Location:
    Sydney
    =A348-A347 ?

    Or more fancy way:
    =DATEDIF(A347,A348,"d")

    Excel gets a bit screwy if the date isn't actually a "date" format. Can happen when you copy in dates from a text source, and it dumps it as text.
     
    breno and JSmithDTV like this.
  3. breno

    breno Member

    Joined:
    May 3, 2011
    Messages:
    1,738
    Location:
    Melbourne
    Sweet! Somebody I can ask what the d stands for because I've found when I put something else in there, the formula doesn't work.

    Edit: and text to columns fixes the numbers as text issues.. Or paste as values (if didn't already know that)
     
  4. NanoDuke

    NanoDuke Member

    Joined:
    Feb 4, 2007
    Messages:
    7,630
    Location:
    Sydney
    See here for more info:
    https://exceljet.net/excel-functions/excel-datedif-function
    "d" returns the number of days.
    Can also be used for months ("m") and years ("y").

    Strangely, there's no context help when you use it in current versions. The link above suggests it was only documented in version 2000.
    I guess because it's so easy to just do your simple arithmetic between two cells. No conversions needed. There's extra formula you can use if you need to calculate the difference in hours/minutes, for example.
     
    breno likes this.
  5. breno

    breno Member

    Joined:
    May 3, 2011
    Messages:
    1,738
    Location:
    Melbourne
    Damn, so obvious it's days lol.. Thanks.
     
  6. NanoDuke

    NanoDuke Member

    Joined:
    Feb 4, 2007
    Messages:
    7,630
    Location:
    Sydney
    It's not the first time someone has asked me what the D is for ;)
     
    breno and PabloEscobar like this.

Share This Page

Advertisement: