Ask Your Question

Nested IF statement to check two cells

asked 2020-10-03 00:37:02 +0200

Bob Mc gravatar image

I need to check two cells in each row, and return "YES" if either have contents, or "NO" if both are empty. Have been trying nested IF statements using OR, but cannot seem to get it to return the correct statement. I know there are several ways of doing this, but think the IF function is probably the easiest.


edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-10-03 02:44:41 +0200

igorlius gravatar image

updated 2020-10-03 15:57:17 +0200


try this


Hope that helps.

edit flag offensive delete link more



if you like it nested:
=IF(A1<>"";"YES";IF(A2<>"";"YES";"NO")) or
but 'grouping' arguments for results as @igorlius or
=IF(OR(A1<>"";A2<>"");"YES";"NO") is 'better',
if you ever write bigger 'programs', it makes a big difference in which thinking logic you approach each problem ...
several ways:
=IF(A1&A2<>"";"YES";"NO") or

newbie-02 gravatar imagenewbie-02 ( 2020-10-03 08:27:59 +0200 )edit

Thank you.

Bob Mc gravatar imageBob Mc ( 2020-10-03 14:42:54 +0200 )edit

@igorlius nitpick: please use the ; semicolon function parameter separator in examples, instead of the , comma separator. Reason is that independent of the localized separator configuration the semicolon is always accepted. Thanks.

erAck gravatar imageerAck ( 2020-10-03 15:49:12 +0200 )edit

@erAck, Sound reasoning. I'll try to keep it in mind from now on. Thanks.

igorlius gravatar imageigorlius ( 2020-10-03 15:59:08 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-10-03 00:37:02 +0200

Seen: 69 times

Last updated: Oct 03 '20