Site icon ExcelNotes

How to Convert a Date to the Month with Two Digits

If you have a date and want to convert into a month in number, you can use the Month function or the Text Function.

When using the Month Function, by default, it returns one digit day number if it is the month from January to September, while the Text function will return a text string.

For example, 5/8/2011 will return 5 when using the month function, and return to 05 or the month name when using the text function.

To convert a date to the month number with 2 digits (e.g., 05), please copy the formula and change the cell name.

=Text(A2,"MM")

If you simply convert a date to a month number as it is, please use the Month Function with the formula below.

=MONTH(A2)

In case you want to turn the date into a month number with 3 digits (e.g., 005), please copy the formula and change the cell names.

=TEXT(Month(A2),"000")

Another method is to format the date into the month number with two digits following the steps below:

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 "mm" in the type box;

Step 4: Click "OK" at the bottom and the dates become numbers in two digits.

Exit mobile version