Excel has two ways to convert a date into a Month and year. And in this tutorial, we will learn both methods in detail.
Use Custom Formatting to Convert Date into a Month, Year, or Month and Year
You can use the below steps for this:
- First, select the cell where you have the date.
- After that, use the shortcut Ctrl + 1 to open the Format Cell option.
- From here, click on the “Custom” category.
- Now, in the type input bar, you must specify the format to apply to the date. For example, you can enter “mmm-yyyy” for Month and Year.
- In the end, click OK to apply the format to the cell.
And when you click OK, it will convert the date into month and year only.
And if you see the formula bar, it’s still a date with day, month, and year. The only difference is the format you have applied to the cell to convert it into month and year.
Below are the few formats that you can use:
- mmm – for the short month name.
- mm – for the month number.
- mmmm – for the long month name.
- yy- for the two-digit year.
- yyyy – for the four-digit year.
Convert into Month and Year into a Separate Cell
Let’s say you need to have the result in a separate cell; in this case, you can use the function TEXT. This function allows you to extract value from a date and then format it as you want.
With text function, you have two arguments to define.
In the first argument (value), specify the date you want to convert to a month and year or a month and a year separately. And in the second argument (format_text), you need to specify the format.
You can use the formats below, which are the same as those we used in the first methods.