假如身份证号码在A1,B1为出生日期,C1为年龄,D1为性别
B1输入公式=IF(LEN(A1)=18,MID(A1,7,4)&""-""&MID(A1,11,2)&""-""&MID(A1,13,2),IF(LEN(A1)=15,""19""&MID(A1,7,2)&""-""&MID(A1,9,2)&""-""&MID(A1,11,2),""""))"
C1输入公式=IF(B1="","",ROUNDUP(YEARFRAC(B1,TODAY()),0))
D1输入公式=IF(AND(LEN(A1)<>18,LEN(A1)<>15),"",IF(ISEVEN(IF(LEN(A1)=18,MID(A1,17,1),IF(LEN(A1)=15,MID(A1,15,1)))),"女","男"))
=if(len(身份证号单元格)=18,mid(身份证号单元格,7,8),IF(LEN(身份证号单元格)=15,"19" & mid(身份证号单元格,7,6),"长度错误"))
如果是2000后的19改20,如果要自动判断19/20,就依样再加个IF()