0% found this document useful (0 votes)
67 views3 pages

Check ID Cards With An Excel Function

This document discusses using Excel functions to verify ID numbers in China. It introduces the format of Chinese ID numbers which have 18 digits including address code, date of birth, sequence code and check code. It then explains how to use the MID, SUM and MOD functions in Excel to extract the first 17 digits from the ID number, calculate their weighted sum, divide the sum by 11 to get the remainder, and compare it to the check code digit to verify if the ID number is valid. The process allows for preliminary verification of ID numbers to check for input errors or forged cards.

Uploaded by

Modou Trawally
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
67 views3 pages

Check ID Cards With An Excel Function

This document discusses using Excel functions to verify ID numbers in China. It introduces the format of Chinese ID numbers which have 18 digits including address code, date of birth, sequence code and check code. It then explains how to use the MID, SUM and MOD functions in Excel to extract the first 17 digits from the ID number, calculate their weighted sum, divide the sum by 11 to get the remainder, and compare it to the check code digit to verify if the ID number is valid. The process allows for preliminary verification of ID numbers to check for input errors or forged cards.

Uploaded by

Modou Trawally
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

Advances in Social Science, Education and Humanities Research, volume 428

International Conference on Education, Economics and Information Management (ICEEIM 2019)

Check ID Cards with an Excel Function


Xianyu Meng1,a,*, Yanping Cui1 and Xiaoyan Cai1
1
Army Engineering University Ordnance Sergeant School, Wuhan, Hubei, China
a
849934279@qq.com
*Corresponding author
ABSTRACT
This paper introduces the rules for the preparation of CHINA's ID number, and elaborates the method of
checking the ID number using functionin in Excel, and elaborates on the function used.
Keywords: excel, ID number, function
verification. The check rule is to take out the first 17 digits
1. INTRODUCTION of the ID card number, multiply by the corresponding
weighting factor and sum s,using S Divide by 11 for the
In various forms that contain personnel information, the ID remainder Y,and then get the ID number 18 by comparison
number is a very important data.This article details the use of check code corresponding table Bits. The verification
Excel function to verify the ID number method, has a strong method is about to calculate the check code and the original
practical value. ID number of the 18th digit comparison, consistent is
The number of China's resident ID card is compiled in through verification, otherwise the ID number is wrong.
accordance with national standards, consisting of 18 digits, Through such preliminary verification can effectively avoid
in order from left to right in order:6 digits of digital address input errors, and even identify some of the forged identity
code,8 The number of digital birth dates, 3-digit sequence cards. The whole process is complex, with an Excel table
codes, and 1-digit check codes. In the id card number instance being implemented step-by-step. Figure 1 is a
preparation rules, the last one is to play the role of soldier information sheet containing the ID number, which
needs to be checked.

Figure
Figure11AAsheet
sheetneed
needto
tobe
bechecked
checked
Numbers
Numbers extracted
extracted from
from the
the MIDMID function
function require
require weighted
weighted
2. HOW TO CHECK sum
sum (the
(the weighted
weighted number
number is
is shown
shown in
in Figure
Figure 4),
4), and
and the
the
2. HOW TO CHECK expression can be written as:
expression can be written as:
=MID(D3,1,1)*7+MID(D3,2,1)*9+MID(D3,3,1)*10+MID(
=MID(D3,1,1)*7+MID(D3,2,1)*9+MID(D3,3,1)*10+MID(
D3,4,1)*5+MID(D3,5,1)*8+MID(D3,6,1)*4+MID(D3,7,1)*
D3,4,1)*5+MID(D3,5,1)*8+MID(D3,6,1)*4+MID(D3,7,1)*
2.1.
2.1. Weighted
WeightedSum Sum 2+MID(D3,8,1)*1+MID(D3,9,1)*6+MID(D3,10,1)*3+MID
2+MID(D3,8,1)*1+MID(D3,9,1)*6+MID(D3,10,1)*3+MID
(D3,11,1)*7+MID(D3,12,1)*9+MID(D3,13,1)*10+MID(D3,
(D3,11,1)*7+MID(D3,12,1)*9+MID(D3,13,1)*10+MID(D3,
The first thing you need to extract is the first 17 digits
The first thing you need to extract is the first 17 digits of of
14,1)*5+MID(D3,15,1)*8+MID(D3,16,1)*4+MID(D3,17,1)
14,1)*5+MID(D3,15,1)*8+MID(D3,16,1)*4+MID(D3,17,1)
your ID number, which can be done with the MID function:
your ID number, which can be done with the MID function: *2
*2
MID(text, start_num, num_chars): Returns characters
MID(text, start_num, num_chars): Returns characters of a of a
Enter
Enter the
the expression
expression in in the
the "Id"Id number
number verification"
verification" cell,
cell,
specified length from the starting position specified
specified length from the starting position specified in thein the
which
which isisE3
E3 cell.
cell.The
The result
resultisisshown
shown in
in Figure
Figure 2.2.
text string.
text string.

Figure 2 The result of weighted sum


MOD(number,
MOD(number, divisor):
divisor): Returns
Returns the the remainder
remainder of of the
the
2.2. division
division of two numbers. The positive and negative sign of
of two numbers. The positive and negative sign
2.2. Finding
Finding the
the Remainder
Remainder the
of
the result
result is
is the
the same
same as
as the
the divisor.
divisor.
Finding The
The summation
summation result
result of
of the
the first
first step
step is
is nested
nested inin the
the MOD
Finding the
the remainder
remainder in
in Excel
Excel can
can be
be realized
realized by
by MOD
MOD function
MOD
function:
function: function as
as aa parameter,
parameter, and
and the
the expression
expression isis as
as follows:
follows:

Copyright © 2020 The Authors. Published by Atlantis Press SARL.


This is an open access article distributed under the CC BY-NC 4.0 license -http://creativecommons.org/licenses/by-nc/4.0/. 251
Advances in Social Science, Education and Humanities Research, volume 428

=MOD(MID(D3,1,1)*7+MID(D3,2,1)*9+MID(D3,3,1)*10+ D(D3,14,1)*5+MID(D3,15,1)*8+MID(D3,16,1)*4+MID(D3,
MID(D3,4,1)*5+MID(D3,5,1)*8+MID(D3,6,1)*4+MID(D3, 17,1)*2,11)
7,1)*2+MID(D3,8,1)*1+MID(D3,9,1)*6+MID(D3,10,1)*3+ The result is shown in Figure 3.
MID(D3,11,1)*7+MID(D3,12,1)*9+MID(D3,13,1)*10+MI

Figure 3 The result of remainder


corresponding check codes, and make the corresponding
2.3. Finding the Check Code relationship between the remainder and the check codes into
a table and store it in another worksheet. The worksheet is
After calculating the remainder, we need to query the named "Check Data", as shown in Figure 4.

Figure 4 Check data


The function,whitch is named “VLOOKUP”,can be used to Check Data!$D$2:$E$12
find check codes according to the remainder in this The third parameter is to find the column where the region
worksheet. target is located. In this case, it is 2. The last parameter logic
VLOOKUP(lookup_value, table_array, col_index_num, value means whether to enable Fuzzy Lookup or not. In this
[range_lookup]): You can use the VLOOKUP function to case, no need to enable, just fill in “0” or “FALSE”.
search for a cell area (region: two or more cells on a Therefore, the synthesis expression is:
worksheet). Cells in a region can be adjacent or not. The first =VLOOKUP(MOD(MID(D3,1,1)*7+MID(D3,2,1)*9+MID(
column then returns the values in any cell on the same row D3,3,1)*10+MID(D3,4,1)*5+MID(D3,5,1)*8+MID(D3,6,1)
in the region. *4+MID(D3,7,1)*2+MID(D3,8,1)*1+MID(D3,9,1)*6+MID
According to the rules of function usage, the first parameter (D3,10,1)*3+MID(D3,11,1)*7+MID(D3,12,1)*9+MID(D3,1
in this example can determine the remainder returned by the 3,1)*10+MID(D3,14,1)*5+MID(D3,15,1)*8+MID(D3,16,1)
previous step. The search area is the D2 to E12 regions of *4+MID(D3,17,1)*2,11), Check Data!$D$2:$E$12,2,0)
the "Check Data" worksheet. The reference method can be The function returns the result as shown in Figure 5.
expressed as follows:

Figure 5 The result of function


EXACT(text1, text2): This function is used to compare two
2.4. Comparison Verification strings: TRUE if they are identical; FALSE if not. The
function EXACT is case-sensitive, but ignores format
The final step requires the check code to be compared with differences. The EXACT function can be used to test the text
the 18th digit of the ID number to check that it is consistent. input in the document.
The ability to check for consistency can be implemented By using the EXACT function to compare the check code
using the EXACT function: and the ID card number at the 18th bit, the expression can be
written as follows:

252
Advances in Social Science, Education and Humanities Research, volume 428

=EXACT(MID(D3,18,1),VLOOKUP(MOD(MID(D3,1,1)*7 D(D3,12,1)*9+MID(D3,13,1)*10+MID(D3,14,1)*5+MID(D
+MID(D3,2,1)*9+MID(D3,3,1)*10+MID(D3,4,1)*5+MID( 3,15,1)*8+MID(D3,16,1)*4+MID(D3,17,1)*2,11), Check
D3,5,1)*8+MID(D3,6,1)*4+MID(D3,7,1)*2+MID(D3,8,1)* Data!$D$2:$E$12,2,0))
1+MID(D3,9,1)*6+MID(D3,10,1)*3+MID(D3,11,1)*7+MI The result is shown in Figure 6.

Figure 6 The last result of check


The result shows that the ID number has passed the
verification if it is “TRUE”, else the ID number has errors.

3. CONCLUSION
Identity cards are very important to everyone. Whether the
authentication is successful or not, the channels of
identification card numbers are usually charged, such as
bank channels and Ministry of Public Security channels.
Before sending validation to these channels, validating them
first can improve the success rate of charging validation and
save cost. It can also improve the user experience, feedback
in time when users input errors without waiting for the return
of validation channel results. Relying on Excel software, this
paper mainly uses Excel function to realize the verification
function. It is easy to operate and difficult to realize. I hope
it can inspire everyone's work and study.

REFERENCES
[1] Xiao Yunting, “Computer Application Foundation”,
Beijing: Machinery Industry Press.
[2] Li Jibing. “Excel Formula and Function Application
Example”, Beijing: China Youth Publishing House.

253

You might also like