电子表格身份证号码应用大全.docx
电子表格身份证号码应用大全15位生成出生年月日:="19"&MID(B2,7,2)&"年"&MID(B2,9,2)&"月"&MID(B2,11,2)&"日" 18位生成出生年月日:=MID(B9,7,4)&"年"&MID(B9,11,2)&"月"&MID(B9,13,2)&"日" =IF(LEN(A1)=15,MID(A1,7,2)&"-"&MID(A1,9,2)&"-"&MID(A1,11,2),MID(A1,7,4)&"-"&MID(A1,11,2)&"-"&MID(A1,13,2) 18位男女识别:=IF(MOD(MID(B2,17,1),2)=1,"男","女") =(IF(B2="","",IF(MOD(MID(B2,17,1),2)=1,"男","女") 15位18位混合:=(IF(B2="","",IF(MOD(IF(LEN(B2)=15,MID(B2,15,1),MID(B2,17,1),2)=1,"男","女") 确定年年龄:=DATEDIF(C2,TODAY,"Y") 提取规定数值:=IF(LEN(A1)=15,MID(A1,7,2)&"-"&MID(A1,9,2)&"-"&MID(A1,11,2),MID(A1,7,4)&"-"&MID(A1,11,2)&"-"&MID(A1,13,2) 1.根据身份证号计算年龄 =IF(A2<>"",DATEDIF(TEXT(LEN(A2)=15)*19&MID(A2,7,6+(LEN(A2)=18)*2),"#-00-00"),TODAY,"y"),) 注意:A2单元格为身份证号,且为文本格式。 2.根据身份证号计算出生年月日 第一种,计算出来的格式为××年××月××日 =IF(LEN(A2)=15,"19"&MID(A2,7,2)&"年"&MID(A2,9,2)&"月"&MID(A2,11,2)&"日",MID(A2,7,4)&"年"&MID(A2,11,2)&"月"&MID(A2,13,2)&"日") 第二种,计算出来的格式为××年××月 =IF(LEN(A2)=15,"19"&MID(A2,7,2)&"年"&MID(A2,9,2)&"月",MID(A2,7,4)&"年"&MID(A2,11,2)&"月") 3.根据身份证号计算性别 =IF(MOD(IF(LEN(A2)=15,MID(A2,15,1),MID(A2,17,1),2)=1,"男","女")