假如身份证号码在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)))),"女","男"))