Excel contains special functions that will let you extract the day, month, and year from a valid date.
Let's take a look.
Here we have a set of random dates in column B. First, I'll add a formula to column C to pick up the date values in B and format them with the General format, so we can see the raw value. You can see that these are normal date serial numbers, and B11 is the only cell that contains a time value.
Using built-in functions, I'll extract the year, month, and day from each date. This can be useful if you want to break apart a date, manipulate certain components, and recombine the date again.
First, I'll extract the day value using a function called DAY. Day takes just one argument: a valid date in serial number format. When I give it the value in column C, it just returns the day from the date.
To get the month value, I need to use the MONTH function. Like the DAY function, MONTH requires only the date and returns the month value from the date.
The Excel DAY function returns the day of the month as a number between 1 to 31 from a given date. You can use the DAY function to extract a day number from a date into a cell. You can also use the DAY function to extract and feed a day value...
The Excel MONTH function extracts the month from a given date as number between 1 to 12. You can use the MONTH function to extract a month number from a date into a cell, or to feed a month number into another function like the...
The Excel YEAR function returns the year component of a date as a 4-digit number. You can use the YEAR function to extract a year number from a date into a cell or to extract and feed a year value into another formula, like the...
The Excel DATE function creates a valid date from individual year, month, and day components. The DATE function is useful for assembling dates that need to change dynamically based on other values in a worksheet.