設日期在A1單元格=IF(DATEDIF(A1,TODAY(),"Y")=1,"5天",IF(DATEDIF(A1,TODAY(),"Y")>1,IF(DATEDIF(A1,TODAY(),"Y")+4<15,DATEDIF(A1,TODAY(),"Y")+4&"天",IF(DATEDIF(A1,TODAY(),"Y")+4>=15,"15天","0天")),"0天")) 如果月份也要計入考慮公式改成 =IF(DATEDIF(A1,TODAY(),"M")=12,"5天",ROUND(IF(DATEDIF(A1,TODAY(),"M")>12,IF(DATEDIF(A1,TODAY(),"M")/12+4<15,DATEDIF(A1,TODAY(),"M")/12+4,IF(DATEDIF(A1,TODAY(),"M")/12+4>=15,15,0)),0),0))&"天" 顯示工作年限=DATEDIF(A1,TODAY(),"M")工作了多少月 =DATEDIF(A1,TODAY(),"Y")工作了多少年
設日期在A1單元格=IF(DATEDIF(A1,TODAY(),"Y")=1,"5天",IF(DATEDIF(A1,TODAY(),"Y")>1,IF(DATEDIF(A1,TODAY(),"Y")+4<15,DATEDIF(A1,TODAY(),"Y")+4&"天",IF(DATEDIF(A1,TODAY(),"Y")+4>=15,"15天","0天")),"0天")) 如果月份也要計入考慮公式改成 =IF(DATEDIF(A1,TODAY(),"M")=12,"5天",ROUND(IF(DATEDIF(A1,TODAY(),"M")>12,IF(DATEDIF(A1,TODAY(),"M")/12+4<15,DATEDIF(A1,TODAY(),"M")/12+4,IF(DATEDIF(A1,TODAY(),"M")/12+4>=15,15,0)),0),0))&"天" 顯示工作年限=DATEDIF(A1,TODAY(),"M")工作了多少月 =DATEDIF(A1,TODAY(),"Y")工作了多少年