Skip to main content
Workforce LibreTexts

5.3: Date and Time Functions

  • Page ID
    14248
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)

    Excel can produce the current date and/or time, based on the computer’s regional settings. Excel can also add and subtract dates and times. For example, it may be necessary to keep track of how many hours an employee worked each week, and calculate their pay and overtime. There are numerous Date and Time functions in Excel to help calculate the addition or difference between dates or times. Excel stores all date and time values as sequential serial numbers. For example, January 1, 1900 is represented by the serial number 1, and January 1, 2020 is represented by serial number 43831 because it is 43,831 days after January 1, 1900. To view the serial number of an existing date, format the date using the General Number format. The conversion of dates and times to serial numbers simplifies the process of using dates and times in calculations. The key to displaying the results of these calculations it using the appropriate Number format, which may require diving into the world of creating custom number formats to display only days, hour and/or minutes. For example, if only the number of years is desired to be displayed when calculating the difference between two dates, the Custom Number format should be yy.

    Date and Time functions
    Date and Time functions

    The TODAY and NOW functions are very similar since both return the current system date. However, the NOW function also returns the current system time. Many users format the results of the NOW function to only display the current system time. One characteristic of these functions versus the DATE function is that TODAY and NOW are volatile functions, so if the workbook is opened tomorrow, these functions will update automatically, whereas the DATE function will not change. These functions are for use within the grid of the worksheet, typically to calculate durations. There are separate Date and Time fields for use in worksheet headers and footers.


    5.3: Date and Time Functions is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Marcus Lacher via source content that was edited to conform to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.