反馈已提交

网络繁忙

You are viewing 5.1 help doc. More details are displayed in the latest help doc.

DATEDIF

  • Recent Updates: April 04, 2022
  • 1. Extracted data

    1)Overview

    SyntaxDATEDIF(start_date,end_date,unit)

    Returns the number of days, months, or years between two specified days.

    Note: 5.1.12 and later returns the difference between end_date and start_date, or a negative value if it is negative.

    Parameter1start_date

    Indicates the initial date of the specified period. Only text and date types are supported.

    Can be a series number in 1900, for example, 35796 is 1998-01-01.

    Parameter2end_date

    Indicates the end date of the specified period. Only text and date types are supported.

    Can be a series number in 1900, for example, 35796 is 1998-01-01.

    Parameter3unit

    The type of information returned by the function. 

    If unit= "Y/y", return the annual difference; 

    If unit= "M/m", return the monthly difference;

    If unit= "D/d", return the day difference; 

    If unit= "MD/md", the year and month are ignored and the day difference is returned; 

    If unit= "YM/ym", the year and day are ignored and the month difference is returned; 

    If unit= "YD/yd", the year is ignored and the day difference is returned

    2)Precautions

    • Supports three parameters, the previous two date or text type parameters, and the third requires text.

    • The third parameter supports Y, M, D, MD, YM, YD and is case insensitive.

    3)Example

    FormulaResultRemark
    DATEDIF("2001/2/28","2004/3/20","Y")3That is three years between February 28, 2001 and March 20, 2004.
    DATEDIF("2001/2/28","2004/3/20","M")37That is 36 full months between February 28, 2001 and March 20, 2004.
    DATEDIF("2001/2/28","2004/3/20","D")1116

    That is 1,116 days between February 28, 2001 and March 20, 2004.

    DATEDIF("2001/2/28","2004/3/20","md")-8
    Ignoring month and year, the difference between February 28, 2001 and March 20, 2004 is -8 days.
    DATEDIF("2001/1/28","2004/3/20","YM")2Ignoring day and year, the difference between January 28, 2001 and March 20, 2004 is 2 months.
    DATEDIF("2001/2/28","2004/3/20","yd")21Ignoring year, the difference between February 28, 2001 and March 20, 2004 is 21 days.
    DATEDIF(35796,35800,"MD")4Ignoring year and month, the difference between January 1, 1998 and January 5, 1998 is 4 days.

    2. Real-time data

    1)Overview

    GrammarDATEDIF(start_date,end_date,unit)

    Returns the number of days, months, or years between two specified days.

    Note: 5.1.12 and later returns the difference between end_date and start_date, or a negative value if it is negative.

    Parameter1start_date

    Indicates the initial date of the specified period. Only text and date types are supported.

    Parameter2end_date

    Indicates the end date of the specified period. Only text and date types are supported.

    Parameter3unit

    The type of information returned by the function. 

    If unit= "Y/y", return the annual difference; 

    If unit= "M/m", return the monthly difference;

    If unit= "D/d", return the day difference; 

    If unit= "MD/md", the year and month are ignored and the day difference is returned; 

    If unit= "YM/ym", the year and day are ignored and the month difference is returned; 

    If unit= "YD/yd", the year is ignored and the day difference is returned.

    2)Precaution

    • Three parameters are supported, the first and second are date or text type parameters, and the third is text type parameter.

    3)Example

    FormulaResultRemark
    DATEDIF("2001-02-28","2004-03-20","Y")3That is three years between February 28, 2001 and March 20, 2004.
    DATEDIF("2001-02-28","2004-03-20","M")37That is 36 full months between February 28, 2001 and March 20, 2004.
    DATEDIF("2001-02-28","2004-03-20","D")1116That is 1,116 days between February 28, 2001 and March 20, 2004.
    DATEDIF("2001-02-28","2004-03-20","md")-8
    Ignoring month and year, the difference between February 28, 2001 and March 20, 2004 is -8 days.
    DATEDIF("2001-01-28","2004-03-20","YM")2Ignoring day and year, the difference between January 28, 2001 and March 20, 2004 is 2 months.
    DATEDIF("2001-02-28","2004-03-20","yd")21Ignoring year, the difference between February 28, 2001 and March 20, 2004 is 21 days.


    Attachment List


    Theme: Advanced Data Analyis
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    售前咨询电话

    400-811-8890转1

    在线技术支持

    在线QQ:800049425

    热线电话:400-811-8890转2

    总裁办24H投诉

    热线电话:173-1278-1526

    文 档反 馈

    鼠标选中内容,快速反馈问题

    鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。

    不再提示

    10s后关闭