Share via

IF/AND/THEN Function

Anonymous
2019-06-05T13:30:45+00:00

Hi everyone :)

I'm attempting to create an IF/THEN formula to do the following:

IF U2, V2, W2, X2, Y2, Z2, AA2, AB2 are all <0, AND S2 isn't blank (it'll be filled with text not numbers), THEN "Comment", but if any of them are >0 then " "

So far I've done

=IF((AND(U2<0,V2<0,W2<0,X2<0,Y2<0,Z2<0,AA2<0,AB2<2)), "COMMENT", "")

Questions: how do I add the AND 'IF S2 isn't blank' portion? Also, the formula seems to work by staying blank if any of the cells are greater than 0, however; it isn't saying "COMMENT" when they aren't.  

Thank you!

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

HansV 462.6K Reputation points
2019-06-05T13:53:37+00:00

=IF(AND(U2<0,V2<0,W2<0,X2<0,Y2<0,Z2<0,AA2<0,AB2<0,S2<>""), "COMMENT", "")

or

=IF(AND(COUNTIF(U2:AB2,">=0")=0,S2<>""), "COMMENT", "")

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2019-06-05T14:00:43+00:00

    They both work perfectly. Thanks for your help!

    Was this answer helpful?

    0 comments No comments