How to extract the year, month and day from the ID number

How to extract the date of birth based on the ID number?

The following is some data, column B is the ID number, the date of birth needs to be extracted to column C

 Method 1: Skill method (data --> column)

Select the column where the ID number is located, click [Data]-->[Column] in the menu bar, in the text column wizard-step 1 pop-up box, select [Fixed Width], and click [Next] .

 In the Text to Columns Wizard - Step 2 pop-up box, after clicking the sixth character, click [Next] before clicking the penultimate character.

 In the dialog box of step 3, click to select the first column, click [Do not import this column], and do the same for the third column; click to select the second column, select [Date] for the column data format, and select the target area C2.

 the result came out

 Method 2: Formula method --TEXT(MID(B2,7,8), "0-00-00")

Enter the formula in cell C2: =--TEXT(MID(B2,7,8), "0-00-00"), click Enter, double-click the fill handle in the lower right corner of cell C2, the formula will be automatically filled .

Formula meaning:
The MID function is used to extract a specific number of character strings starting from the specified position of the character string.
MID(B2,7,8) is to extract 8 digits from the 7th digit of cell B2, and the result is "19840523".
Then use the TEXT function to change this string into the style of "0-00-00", and the result is "1984-05-23".

Guess you like

Origin blog.csdn.net/Doulvme/article/details/130380020