EXCEL合同到期时间提醒
如果单元格A2是合同的起始时间,单元格B2是合同的终止时间,则在单元格C2下应该输入如下代码:
=IF(ISERROR(DATEDIF(TODAY(),B2,"D")),"已过期
",IF(DATEDIF(TODAY(),B2,"D")>30,"未到期",IF(DATEDIF(TODAY(),B2,"D")=30,"今天到期","差"&DATEDIF(TODAY(),B2,"D")&"天到期")))
如果要让到期提醒变换字体样式,则:
选中C列,选择菜单栏的格式→条件格式→公式后,输入
=AND(DATEDIF(TODAY(),B2,"D")<=30,DATEDIF(TODAY(),B2,"D")>0)
再点击格式来设置自己所需要的效果即可!
=IF(ISERROR(DATEDIF(TODAY(),B2,"D")),"已过期",IF(DATEDIF(TODAY(),B2,"D")>30,"未到期",IF(DATEDIF(TODAY(),B2,"D")=30,"今天到期","差"&DATEDIF(TODAY(),B2,"D")&"天到期")))
试试看