Using WPS form to extract personal information of ID card

Source: Internet
Author: User

First, the article introduction:

  This article mainly introduces how to use the function of WPS table, according to personal identification number, to extract the date of birth, sex and so on, to realize the automatic entry of personal information.

Second, skillfully use the function of WPS function

Recently, the unit needs to report a staff information, including personal identity card number, and the date of birth, gender and other information. Due to a large number of people, input is really troublesome, and error prone, not to get rework. Can have a once and for all, quickly and accurately enter the date of birth, sex and other personal information? Yes! Because the ID card contains these personal information, we use the WPS form can easily extract some personal information, in order to achieve automatic entry, and quickly and accurately to complete the work.

At present, China's identity card number is divided into two kinds, one is 15-digit, one for 18-bit. In the 15-bit old version of the ID card, the 7th to 12th digit is the date of birth, the last one is sex code, even number is female, odd is male. The 7th to 14th digit of the 18-digit new ID card is the date of birth, the 2nd digit is the sex code, the same even number is female and the odd number is male.

Based on this feature, we can use the function to judge. Figure 1 is the employee Information table that has already entered the ID card number, should notice when entering the ID card, the format of the cell should be formatted as text, or add a single quote "'" in front of the ID number.

Figure 1 Entering the identification number in the WPS form

1. Extraction Date of birth

In D2, enter the formula "=if (C2) =15,text (Mid (c2,7,6)," 0 days "), TEXT (Mid (c2,7,8)," 0 days ")", drag the fill handle down to copy the formula, This completes the extraction of the date of birth (Figure 2):

Fig. 2 using WPS to extract birth date

2, the extraction of gender information

In E2, enter the formula "=if (MOD (C2) =15,mid (c2,15,1), MID (c2,17,1)), 2 = 1," Male "," female "), drag the fill handle down to copy the formula, thus completing the extraction of the sex information (Figure 3):

Figure 3 using WPS form to extract gender information

The formula is detailed: Len is the length function, mid is to extract the character function, text is the conversion format function, mod is the division function, if is the Judge function. The date of birth formula means that if the ID number is 15 digits, the 6 characters from the 7th position are converted to the format of "0 days", otherwise (i.e. 18 ID), the 8 characters from the 7th digit are converted to the "0 days" format. The formula for the extraction of gender information means that if the ID number is 15 digits, divide the 15th and 2 evenly, if divided, shown as female, not divisible, shown as male, ID number 18 digits, the 15th and 2 divisible, if the division, display as female, not divisible, shown as male. In addition, if you want to convert your birth date to a true date type, simply add two minus signs to the formula in front of text, which is the offload operation, and then set the specific date type of the cell as needed.

The above is only in the correct situation of ID card entry set, if the ID card number input error, such as the number is wrong, the date information is wrong (such as the monthly score of more than 12, the number of days in February there are 31st), how to do? or leave it to everyone to think about it! Learn to extrapolate yo.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.