Search code examples
google-sheetsgoogle-sheets-formulaoperatorsdry

How to avoid repeating multiple conditions in OR function using Arrayformula?


I have this google sheets input.

Players Loot
Player1 4
Player2 4
Player3 5
Player4 2

What I'm attempting to do is simplify this formula in order to get TRUE in a single cell.

=OR(B2>=5,B3>=5,B4>=5,B5>=5)

This is what i did so far.

=ArrayFormula(SUM((B2:B5*1>=5)*1))>0

Can this formula be simplied further and still get TRUE in a single cell when one of Loot values is >= 5?


Solution

  • Select the entire range B2:B5 and check if it's greater than 5 using >=. >= operator supports arrays. OR merges the values to a single cell.

    =ARRAYFORMULA(OR(B2:B5>=5))
    

    AND can be used in a similar way.