本帖最后由 m678 于 2023-6-7 19:27 编辑
怎么公式结果不一样
解决
我求A2
=IF(MONTH(TEXT(DATE(LEFT(A2,4),RIGHT(A2,2),1),"yyyy-m"))>=9,DATEDIF(TEXT(DATE(LEFT(A2,4),RIGHT(A2,2),1),"yyyy-m"),TODAY(),"Y")-1,DATEDIF(TEXT(DATE(LEFT(A2,4),RIGHT(A2,2),1),"yyyy-m"),TODAY(),"Y"))
=IF(MONTH(TEXT(DATE(LEFT(A2,4),RIGHT(A2,2),1),"yyyy-m"))>=9,DATEDIF(TEXT(DATE(LEFT(A2,4),RIGHT(A2,2),1),"yyyy-m"),DATE(2023,8,31),"Y")-1,DATEDIF(TEXT(DATE(LEFT(A2,4),RIGHT(A2,2),1),"yyyy-m"),DATE(2023,8,31),"Y"))
精简后
=DATEDIF(TEXT(A2,"0000-00"),TODAY(),"Y")-(RIGHT(A2,2)*1>=9)
=DATEDIF(TEXT(A2,"0000-00"),DATE(2023,8,31),"Y")-(RIGHT(A2,2)*1>=9)
=DATEDIF(TEXT(A2,"#-00"),DATE(2023,8,31),"Y")-(MONTH(TEXT(A2,"#-00"))>=9)
谢谢
|