Share via

IF AND statement referencing multiple cells

Anonymous
2016-04-05T22:00:48+00:00

I'm trying to create an IF statement based on answers provided in multiple cells.  For example:

If C2<6 and C4=yes, then Worksheet

If C2<6 and C4=no, then Form

If C2>=6 and C4=yes, then Nothing

If C2>=6 and C4=no, then Memo

Here's one of the arguments I've been trying but I get a #VALUE error.

=IF(AND(C2<6,C4="yes"),"Worksheet"),IF(AND(C2<6,C4="No"),"Form"),IF(AND(C2>=6,C4="yes"),"Nothing"),IF(AND(C2>=6,C4="No"),"Memo")))))))

Any advice or solutions would be greatly appreciated!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Kevin Jones 7,265 Reputation points Volunteer Moderator
2016-04-06T18:40:13+00:00

Use this if you want the answer blank if either C2 or C4 are blank:

=IF(OR(C2="",C4=""),"",IF(C2<6,IF(C4="yes","Worksheet","Form"),IF(C4="yes","Nothing","Memo")))

Use this if you want the answer blank if both C2 and C4 are blank:

=IF(AND(C2="",C4=""),"",IF(C2<6,IF(C4="yes","Worksheet","Form"),IF(C4="yes","Nothing","Memo")))

Kevin

Was this answer helpful?

0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2016-04-07T11:27:51+00:00

    use below formula.

    =IF(AND(C2<6,C4="Yes"),"WorkSheet",IF(AND(C2<6,C4="No"),"Form",IF(AND(C2>=6,C4="Yes"),"Nothing",IF(AND(C2>=6,C4="No"),"Memo"))))

    Use this if you want the answer blank if either C2 or C4 are blank.

    =IF(AND(C2<6,C4="Yes"),"WorkSheet",IF(AND(C2<6,C4="No"),"Form",IF(AND(C2>=6,C4="Yes"),"Nothing",IF(AND(C2>=6,C4="No"),"Memo",IF(AND(C2="",C4=""),"")))))

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-04-06T16:39:14+00:00

    This worked!  However, I want the answer cell to stay blank when the C2 and C4 are blank (haven't been answered yet).  I tried to add IF(C2="","") to the beginning (and end) of the argument, but I'm getting an error message.  Any suggestions?  I appreciate your help!

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-04-06T04:47:34+00:00

    This will give your results:

    =IF(C2<6,IF(C4="yes","Worksheet",IF(C4="no","Form","")),IF(C4="yes","Nothing",IF(C4="no","Memo","")))

    The formula will also return a blank cell if C4 is neither "yes" or "no" or is blank.

    Regards,

    Amit Tandon

    Was this answer helpful?

    0 comments No comments
  4. Kevin Jones 7,265 Reputation points Volunteer Moderator
    2016-04-05T22:13:27+00:00

    =IF(C2<6,IF(C4="yes","Worksheet","Form"),IF(C4="yes","Nothing","Memo"))

    Kevin

    Was this answer helpful?

    0 comments No comments