In Excel, there are solutions for every problem that we have. This refers to both mathematical, logical, and graphical issues, as well.
It is also possible to manipulate the data in any way possible. In the example below, we will show how can the user convert a month that is written in numbers to months in a string or return the month name.
Convert Month Number to Month Name
For the example, we will use random dates:
To extract the month out of these dates, we will use a simple TEXT formula.
This is the formula that we will insert into cell B2:
1 |
=TEXT(A2, "mmmm") |
In cell B3, we will write down one “m” letter less:
1 |
=TEXT(A3, "mmm") |
And in cell B4, we will write one letter more than in the B2 cell:
1 |
=TEXT(A4, "mmmmm") |
These are the results that we will get:
As seen, the name of the month that is extracted depends on the text format that we define. When we insert four “mmmm”, we get the full name of the month, three “mmm” we get the shortened version, and when we insert five letters “m”, we get only the first letter of the month in question.
We can also use the TEXT formula in a combination with the DATE formula to define the date within the same cell. We will insert the following formula in cell D2:
1 |
=TEXT(DATE(2021,3,23), "mmm") |
As seen, we will define the date as March 3rd, 2021, but the return format will be a shortened month:
Convert Numbers to Months
We can also use the TEXT formula to get the month names from a list of numbers (1 to 12). We will write down the numbers in cells F2:F13. In cell G2, this is the formula we will insert:
1 |
=TEXT(F2*29,"mmmm") |
And will drag this formula till the end of our list:
We will get the months that we need, chronologically.