Home > database >  Sheets IFS function with multiple AND operators
Sheets IFS function with multiple AND operators

Time:01-04

I'm trying to do a sheets function to look for a few different strings AND also check if another column is at least a minimum number.. I tried a few different variations of using IF, AND and IFS functions but cant get it working with multiple AND operators in the logical conditions.. The sheets functions are kinda weird and I just started using them.. There's probably a better way but it's only like 3 strings so this is fine too but they all evaluate to TRUE when one condition is not true like row 2 and 3..

I may have misunderstood this function, I thought it was like the following and returned the first true condition?

IFS(logical op, value, logical op, value..)

Here's a link with test data (removed)

The function looks like this:

=IFS( A1 = "text" & B1 > 4, TRUE, A1 = "text2" & B1 > 4, TRUE, A1 = "text3" & B1 > 4, TRUE)

Thanks!

CodePudding user response:

You need to use AND() function inside IFS(). Try-

=IFERROR(IFS(AND(A1="text",B1>4), TRUE,AND(A1="text2",B1>4),TRUE,AND(A1="text3",B1>4),TRUE),FALSE)

You can also use MAP() function to make it dynamic.

=MAP(A1:A3,B1:B3,LAMBDA(x,y,OR(x="text",x="text2",x="text3")*(y>4)))

enter image description here

  • Related