excel巢狀公式IF語句輔助

excel巢狀公式IF語句輔助
=IF([@[Date Last Revised]]>[@[Date of Last Biennial Review]],[@[Date Last Revised]]+730,IF([@[Date of Last Biennial Review]]>[@[Date Last Revised]],[@[Date of Last Biennial Review]]+730),IF([@[Date Last Revised]]=[@[Date of Last Biennial Review]],[@[Biennial Review Date]]))

這是我的職責。它一直有效,直到我加入了 Last If 語句。因為如果上次修改日期和兩年期審核日期相同,它只是顯示「錯誤」。有人可以幫忙嗎?

答案1

透過將公式格式化為:

=IF([@[Date Last Revised]]>[@[Date of Last Biennial Review]],[@[Date Last Revised]]+730,
 IF([@[Date of Last Biennial Review]]>[@[Date Last Revised]],[@[Date of Last Biennial Review]]+730),
IF([@[Date Last Revised]]=[@[Date of Last Biennial Review]],[@[Biennial Review Date]]))

)您可以在第二個 IF 末尾看到錯誤。它應該在公式的末尾:

=IF([@[Date Last Revised]]>[@[Date of Last Biennial Review]],[@[Date Last Revised]]+730,
 IF([@[Date of Last Biennial Review]]>[@[Date Last Revised]],[@[Date of Last Biennial Review]]+730,
IF([@[Date Last Revised]]=[@[Date of Last Biennial Review]],[@[Biennial Review Date]])))

但這可以簡化,因為您沒有使用第三個公式中的 false 來:

=IF([@[Date Last Revised]]>[@[Date of Last Biennial Review]],[@[Date Last Revised]]+730,
 IF([@[Date of Last Biennial Review]]>[@[Date Last Revised]],[@[Date of Last Biennial Review]]+730,[@[Biennial Review Date]]))

相關內容