怎样计算和确定身份证号码的最后一个数字
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 07:34:02
怎样计算和确定身份证号码的最后一个数字
怎样计算和确定身份证号码的最后一个数字
怎样计算和确定身份证号码的最后一个数字
假如身份证号在A2,在B2输入:=RIGHT(A2,1)
在EXCEL中,编辑代码
Function idcode(sCode As String) As String
Dim I As Integer
Dim num As Integer
Dim Code As String
num = 0
idcode = sCode
For I = 18 To ...
全部展开
在EXCEL中,编辑代码
Function idcode(sCode As String) As String
Dim I As Integer
Dim num As Integer
Dim Code As String
num = 0
idcode = sCode
For I = 18 To 2 Step -1
num = num + (2 ^ (I - 1) Mod 11) * (Mid(idcode, 19 - I, 1))
Next I
num = num Mod 11
Select Case num
Case 0
Code = "1"
Case 1
Code = "0"
Case 2
Code = "X"
Case Else
Code = Trim(Str(12 - num))
End Select
idcode = idcode + Code
End Function
收起
身份证号码后面四位是电脑随机取的,倒数第二位表示性别,奇数为男,偶数为女
32092319511108321