Site icon ExcelNotes

How to Convert a Date into Year with Two Digits

Text FunctionData Formatting

When working with dates, you often need to covert a date into a year number. You can use the Year Function or the Text Function.

When using the Year Function, by default, it returns the number with four digits. For example, 5/8/2011 will return 2011, while the Text function will return a text string which can be a number with 2 digits or 4 digits.

To convert a date to a year number with 2 digits (e.g., "2011" to "11"), please copy the formula and change the cell name.

=Text(A2,"YY")

If you simply convert a date to a number with 4 digits, you can either use the Year function or the Text function. The Year function returns a number and the Text function returns a text string.

=Year(A2)
=Text(A2,"YYYY")

Alternatively, you can format the date into the number with two digits:

Step 1: Select the date range and click the "Home" tab from the ribbon;

Step 2: Click the right bottom corner in the "Number" group;

Step 3: In the "Format Cell" window, click "Custom" and type "yy" in the type box;

Step 4: Click "OK" at the bottom and the dates become years with two digits.

Exit mobile version