Search code examples
arraysif-statementgoogle-sheetsarray-formulasgoogle-query-language

Google Sheets OR statement is not performing an exact match


I have the formula below in a heading cell.

The problem is that any rows where BKW are in column B are also being seen as true. It is as if testing for B2:B="BRKW" is not an exact match.

Here is a link as an example: https://docs.google.com/spreadsheets/d/1Yno7jDm2h2EjTXqwHTFFH-bCrIHSjwyAmMWed344ltc/edit?usp=sharing In this example link, cell C3 should be "ABC"

={"Formula";ArrayFormula(
      if(
        OR(B2:B="BRKW", B2:B="GKW1-2"),
        if(
          D2:D <= A2:A,
          D2:D,
          A2:A
        ),
        "abc"
      )
)}

Solution

  • use:

    ={"Formula";ArrayFormula(
          if(
            (B2:B="BRKW")+(B2:B="GKW1-2"),
            if(
              D2:D <= A2:A,
              D2:D,
              A2:A
            ),
            "abc"
          )
    )}
    

    OR is not supported under ARRAYFORMULA