Brian Samson
Brian Samson

Reputation: 116

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!

Upvotes: 5

Views: 9748

Answers (2)

Kyle
Kyle

Reputation: 11

You can accomplish this via a COUNTIF function

=IF(COUNTIF(A1:C3,A3)>0,"Yes!")

Upvotes: 1

player0
player0

Reputation: 1

try:

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

0

Upvotes: 2

Related Questions