How to Use the TODAY Function in Excel
The TODAY function in Excel and Google Sheets returns the current date.
Basic Syntax
The syntax for the TODAY function is consistent across both Excel and Google Sheets:
=TODAY()
Example Usage
Below are some practical examples of how the TODAY function can be utilized:
Example 1: Displaying the Current Date
To display the current date in a cell, simply enter the following formula:
=TODAY()
Example 2: Calculating Age
To calculate a person’s age in years from their birthdate, given that their birthdate is in cell A1, use this formula:
Formula | Result |
---|---|
=DATEDIF(A1, TODAY(), "Y") |
Age in years |
Example 3: Conditional Formatting Based on Date
The TODAY function can also be integrated with conditional formatting to highlight cells that match the current date. To set this up, follow these steps:
- Select the range of cells you wish to format.
- Access the Conditional Formatting option.
- Opt for “Use a formula to determine which cells to format.”
- Enter the formula
=A1=TODAY()
(assuming A1 is the top-left cell within your selected range). - Choose your desired formatting style.
This overview provides just a few ways the TODAY function can be employed in Excel and Google Sheets to efficiently manage date-related tasks.
More information: https://support.microsoft.com/en-us/office/today-function-5eb3078d-a82c-4736-8930-2f51a028fdd9