Excel中的多个IF语句 [英] Multiple IF statements in Excel
问题描述
如何在带有多个IF语句的Excel中执行此操作:-
How can I do this in Excel with Multiple IF statements:-
条件:- 1)如果Mfc日期不为null,则Mfc日期 2)如果Mfc为空,则Rcv日期 3)如果Mfc& Rcv日期为空,然后为Tran日期
The conditions:- 1) If Mfc Date is not null, then Mfc Date 2) If Mfc is null, then Rcv Date 3) If both Mfc & Rcv Dates are null, then Tran Date
谢谢.
推荐答案
IF
函数具有以下结构:
IF(logical_test, [value_if_true], [value_if_false])
您可以在[value_if_true]
和/或[value_if_false]
参数中嵌套更多的IF.
You can nest further IF's in the [value_if_true]
and/or [value_if_false]
arguments.
在特定情况下,请将其粘贴到E2中并向下拖动:
In your particular case, paste this in E2 and copy-drag down:
=IF(ISERROR(C2),IF(ISERROR(B2),D2,B2),C2)
现在,这假设您的日期有时是#NULL!
,就像您的问题所暗示的那样,但我怀疑这实际上是您的意思.也许你的意思是空白?还是其他一些价值?如果您的意思是空白,则在上面用ISBLANK
替换ISERROR
.
Now, this assumes that your dates are sometimes #NULL!
like your question suggests, but I doubt that this is what you actually mean. Maybe you mean blank? Or some other value? If you do mean blank, then replace ISERROR
with ISBLANK
in the above.
这篇关于Excel中的多个IF语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!