Search code examples
arraysif-statementgoogle-sheetsgoogle-sheets-formulaarray-formulas

How to use an IF statement to compare value against array in Google Sheets


Image of Google Sheet Data

In cell A4, I have a value, lets say clt. In A5 I have the following formula:

=if(A4 = {A$1:$C$3}, 0, "Yes!")

Clearly, it's not working but I hope you can appreciate the logic I am attempting. Also, this is a quick representation of my example as the actual dataset is confidential.

Any direction is appreciated!


Solution

  • try:

    =ARRAYFORMULA(IF(A4=A1:C3, 0, "Yes!"))
    

    0