|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
若输入身份证,要求在下一格自动显示出生日期~应该怎么办?
1、根据身份证号码求性别: =IF(LEN(B2)=15,IF(MOD(VALUE(RIGHT(B2,3)),2)=0,"女","男"),IF(LEN(B2)=18,IF(MOD(VALUE(MID(B2,15,3)),2)=0,"女","男"),"身份证错"))
2、根据身份证号码求出生年月日: =IF(LEN(B2)=15,CONCATENATE("19",MID(B2,7,2),"-",MID(B2,9,2),"-",MID(B2,11,2)),IF(LEN(B2)=18,CONCATENATE(MID(B2,7,4),"-",MID(B2,11,2),"-",MID(B2,13,2)),"身份证错"))
3、根据身份证号码求年龄: =IF(LEN(B2)=15,year(now())-1900-VALUE(MID(B2,7,2)),if(LEN(B2)=18,year(now())-VALUE(MID(B2,7,4)),"身份证错")) |
|