Search code examples
google-sheetsgoogle-sheets-formulanested-if

MINIFS using OR function


I’m trying to find the minimum date in column B if any cell in columns E, F, or G contains the word banana.

Give the minimum date in column B
IF: column E contains “banana”
OR IF: column F contains “banana”
OR IF: column G contains “banana”

I’m not quite sure how to nest these statements or if an array formula is needed. I tried a variety of nested MAX(IF(OR formulas but kept getting a parse error. Also tried an array but also got a parse error. Appreciate help trying to understand how to get this formula.


Solution

  • Also

    =min(filter(B:B,(D:D="Banana")+(E:E="Banana")+(F:F="Banana")))
    

    (you can only get an AND condition out of MINIFS - see this question for how to get an OR condition generally)

    Here is a version that finds "Banana split" etc.

    =min(filter(B:B,isnumber(search("Banana",D:D))
                   +isnumber(search("Banana",E:E))
                   +isnumber(search("Banana",F:F))))