In Excel, you can quickly get the Month and Year from a date. If you want to know how to do that? Then we are here to assist you to know the steps. Let’s see some simple instructions to Convert Date to Month & Year Only in Excel Office 365 using TEXT Function. Get into this article!!
Definition and Syntax of TEXT Function:
- The TEXT Function in Excel converts a number to text in the given format.
- If you want to combine numbers with symbols/ text, or you want to display numbers in a more readable format, then this function will be useful in those situations.
=TEXT(value, format_text)
Argument Explanation:
- Value – A number that you want to convert into text.
- Format_text – The format that you want to apply to the given value.
Practical Example:
Let’s see an example to make it clear how it works.
- Here, we are going to change the date ( mm-dd-yyyy ) to yyyy-mm format.
- To achieve this, we will use the Text function with this format code (yyyy-mm).
- You can apply the below formula to get the month and year from the specific date.
=TEXT(date,”yyyy mm”)
- You can see that the formula is entered in cell B3 and the input date is given in cell B2.
- After applying the formula, you need to click the Enter button to get the result.
- Refer to the below screenshot.
Convert Date to Month and Year with Format Cell:
You can change the data to month and year with the help of the format cell option. To do this, follow the below steps.
- First, you need to select the cell that you want to display a date with the year and month.
- Then right-click on the cell and select the Format Cells option from the menu.
- On the Number Tab, you need to select the Custom Category on the left pane.
- You need to enter the format “yyyy-mm” in the Type box.
- Click the OK option to see the result as shown in the below image.
More Format Codes:
The below-given table will help to know more format codes in Excel formatting. Make use of it.
| Format
Code
Description | Examples | |
---|---|---|
0 | It will display the digits in their place. It can force the function to display at least two decimal places. | =TEXT(18.3012, “$##.00”) |
Output = $18.30
|
| # | This will display the placeholder. |
=TEXT(5.678, “#.##”)
Output = 5.66
|
| . | It shows the position of the decimal point. | =TEXT(45.4, “0.00”)
Output = 45.40
|
| d | Represents the day of the month or day of the week. | =TEXT(TODAY(), “dddd”)
Output = Monday
|
| m | It refers to the month of the year. | =TEXT(TODAY(), “MM/DD/YY”)
Output = 01/04/21
|
| y | Year | =TEXT(TODAY(), “MM/DD/YY”)
Output = 01/04/21
|
| h | Hour is represented by one or two-digit number. | =TEXT(15:20, “hh:mm”)
Output = 15:20
|
| m | Minute | =TEXT(14:15, “hh:mm”)
Output = 14:15
|
| s | Second | Nil |
End of the Article:
In this short article, you can easily learn the instructions to Convert Date to Year and Month Only in Excel Office 365 using TEXT Function. If you have any queries/suggestions, kindly drop it in the below comment box. Thanks for visiting Geek Excel!! Keep Learning!!
Top comments (0)