Current location - Recipe Complete Network - Complete cookbook of home-style dishes - How to extract the year and month of date format in excel? Example: the extraction result of 20 10- 12-15 is 2010-12. The extracted result text format
How to extract the year and month of date format in excel? Example: the extraction result of 20 10- 12-15 is 2010-12. The extracted result text format
You can use the left (cell, number) formula to extract everything:

If 2010-12-15 is in cell A 1, that is, in cell B 1- 12, enter =left(A 1, 7).

In view of the fact that the month in the date has one digit and two digits, and the text is required, the text (A 1, "yyyy-mm") is used.