top of page

You are learning Functions and Formulas in MS Excel

What does the YEAR, MONTH, DAY function do?

In Excel, YEAR, MONTH, and DAY are workhorse functions for dissecting dates stored as serial numbers. Dates themselves aren't directly stored that way in Excel, but rather as sequential numbers representing days elapsed since January 1, 1900. These functions help you extract specific components like year, month, or day from these serial numbers.

Here's a closer look at each function and how they can be used:

* YEAR(date): This function is like a time capsule opener for your date. It takes a date as input, either a serial number representing a date or a cell reference containing a date, and returns the year as a four-digit integer.
* Example: Let's say cell A1 holds a date. You can use `=YEAR(A1)` to extract the year value from that date.

* MONTH(date): This function unveils the month hidden within the serial number representing a date. It takes a date as input and returns the month as a number, ranging from 1 for January to 12 for December.
* Example: Need the current month number? `=MONTH(TODAY())` will do the trick. This formula leverages another function, TODAY(), which returns the current date.

* DAY(date): This function isolates the day of the month from the date's serial number disguise. It takes a date as input and returns the day as a number (from 1 to 31).
* Example: Suppose you have a date in cell B3. You can use `=DAY(B3)` to extract the day number from that date.

Beyond the Basics:

These functions are particularly useful when combined with the DATE function. DATE allows you to construct a date by providing separate values for year, month, and day. By using YEAR, MONTH, and DAY in formulas along with DATE and other functions, you can perform powerful calculations and manipulations on dates within your spreadsheet.

For instance, imagine you have a list of purchase dates in one column and want to calculate the age (in years) of each purchase. You can use the YEAR function on both the purchase date and today's date (using TODAY()) within a formula to subtract the year of purchase from the current year, reflecting the item's age.

bottom of page