I want to calculate difference of second date (year) and first date(year). I cannot write formula in excel.
我想计算第二次(年)和第一次(年)的差值。我不会用excel写公式。
if(quitDate is not empty)
{
quitDate - startDate
}
else
{
presentDate - startDate
}
I know only these two formulas =YEAR(NOW)-YEAR(A1) and = YEAR(B1)-YEAR(A1)
我只知道这两个公式=年(现在)年(A1) =年(B1)年(A1)
1 个解决方案
#1
1
I suggest:
我建议:
=IF(quitDate<>"",quitDate-startDate,NOW()-startDate)
where I have used Named Ranges (each one cell) for the two dates. I imagine you would prefer to replace those with suitable A1
references to make copying easier.
这里我使用了命名范围(每个单元格)来表示两个日期。我想你可能更喜欢用合适的A1引用替换它们,以便更容易复制。
#1
1
I suggest:
我建议:
=IF(quitDate<>"",quitDate-startDate,NOW()-startDate)
where I have used Named Ranges (each one cell) for the two dates. I imagine you would prefer to replace those with suitable A1
references to make copying easier.
这里我使用了命名范围(每个单元格)来表示两个日期。我想你可能更喜欢用合适的A1引用替换它们,以便更容易复制。