因为D1是由B1计算出来的,所以你去掉B1,当然D1也变了。
只用一个公式就行了:
=YEAR(TODAY())-YEAR(TEXT(IF(LEN(A1)=15,"19"&MID(A1,7,2)&"-"&MID(A1,9,2)&"-"&MID(A1,11,2),MID(A1,7,4)&"-"&MID(A1,11,2)&"-"&MID(A1,13,2)),"yyyy-mm-dd"))
B1是过渡公式,可以将D1的公式中的B1换成 B1的整个公式:
=YEAR(TODAY())-YEAR(TEXT(IF(LEN(A1)=15,"19"&MID(A1,7,2)&"-"&MID(A1,9,2)&"-"&MID(A1,11,2),MID(A1,7,4)&"-"&MID(A1,11,2)&"-"&MID(A1,13,2)),"yyyy-mm-dd"))
=DATEDIF(IF(LEN(A1)=15,DATE(MID(A1,7,2),MID(A1,9,2),MID(A1,11,2)),DATE(MID(A1,7,4),MID(A1,11,2),MID(A1,13,2))),TODAY(),"y")
D1计算年龄:
=DATEDIF(TEXT(MID(A1,7,LEN(A1)*2/3-4),"0-00-00"),TODAY(),"Y")