开发者

Multiple IF statements in Excel

开发者 https://www.devze.com 2023-03-17 06:25 出处:网络
开发者_C百科How can I do this in Excel with Multiple IF statements:- The conditions:- 1) If Mfc Date is not null, then Mfc Date
开发者_C百科

How can I do this in Excel with Multiple IF statements:-

Multiple IF statements in Excel

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

Thanks.


The IF function has the following structure:

IF(logical_test, [value_if_true], [value_if_false])

You can nest further IF's in the [value_if_true] and/or [value_if_false] arguments.

In your particular case, paste this in E2 and copy-drag down:

=IF(ISERROR(C2),IF(ISERROR(B2),D2,B2),C2)

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.


Here is how you'd write in for say, HIJ assuming by NULL you mean the value 0 and not empty cell:

=IF(C4>0,C4,IF(B4>0,B4,D4))

In layman's terms, If C4 is greater than 0, give me C4, if it's not then tell me if B4 is greater than 0, and if it is, give me B4, otherwise, just give me D4).

0

精彩评论

暂无评论...
验证码 换一张
取 消