你公式算出的年龄是文本格式,把你计算年龄的公式写出来,看怎样改比较合适。
=--IF(C1="","",IF(IF(LEN(C1)=15,"19"&MID(C1,7,2)&"-"&MID(C1,9,2)&"-"&MID(C1,11,2),MID(C1,7,4)&"-"&MID(C1,11,2)&"-"&MID(C1,13,2))>"2009-12-31","",TEXT(TODAY()-IF(LEN(C1)=15,"19"&MID(C1,7,2)&"-"&MID(C1,9,2)&"-"&MID(C1,11,2),MID(C1,7,4)&"-"&MID(C1,11,2)&"-"&MID(C1,13,2)),"yy")))
(在等号后IF前添加“--”)
给你一个求年龄的公式,看看是否适用:
=IF(C1<>"",DATEDIF(TEXT((LEN(C1)=15)*19&MID(C1,7,6+(LEN(C1)=18)*2),"#-00-00"),TODAY() ,"y"),)