Use this function to return the sequential serial number that represents a particular date. This function is most useful in situations where the year, month, and day are supplied by formulas or cell references. For example, you might have a worksheet that contains dates in a format that Excel does not recognize, such as YYYYMMDD.Use the DATEDIF function to calculate the number of days, months, or years between two dates.