发布者:郑力 所属单位:通江县实验中学 发布时间:2017-04-29 浏览数( -) 【举报】
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)),IF(LEN(B2)=18,CONCATENATE(MID(B2,7,4),".",MID(B2,11,2)),"身份证错"))
=IF(LEN(E3)=15,CONCATENATE("19",MID(E3,7,2),".",MID(E3,9,2)),IF(LEN(E3)=18,CONCATENATE(MID(E3,7,4),"年",MID(E3,11,2),"月",MID(E3,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)),"身份证错"))
4、根据身份证号码求自生肖:
=IF(LEN(E3)=15,MID("鼠牛虎兔龙蛇马羊猴鸡狗猪 ",MOD("19"&MID(E3,7,2)-4,12)+1,1),MID("鼠牛虎兔龙蛇马羊猴鸡狗猪",MOD(MID(E3,7,4)-4,12)+1,1))
5、从单元中提示左边或右边内容:
左:=left(A2,2);右:=right(a2,2),A2表示目标单元格,2表示汉字个数.