Forum Discussion

Tinny426's avatar
Tinny426
Brass Contributor
Sep 09, 2026
Solved

How to add another criteria to FILTER function

Hi all, I am using the FILTER formula in my spreadsheet and i need to have two criteria "J" and "jj". How do I modify this ? !B3:B241="J"

  • Tinny426​ Put each criterion between brackets and join them together with + for an OR, or * for an AND.

    If you want to check if B3:B241 contains either "j" or "jj" it could look like this:

    =FILTER( .........., (B3:B241="j")+(B3:B241="jj") )

     

8 Replies

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Similar to what I suggested earlier, that would then be:

    =SORT(FILTER('******************* SEP 11-27'!A3:C239,('****************** SEP 11-27'!B3:B239="j")+('****************** SEP 11-27'!B3:B239="jj")),3,-1)

    Obviously, when there are no rows that match these criteria (either j or jj), then SORT will error out, and you need to wrap the formula in IFERROR. Something like this:

    =IFERROR(SORT(FILTER('******************* SEP 11-27'!A3:C239,('****************** SEP 11-27'!B3:B239="j")+('****************** SEP 11-27'!B3:B239="jj")),3,-1), "No match")

    • Tinny426's avatar
      Tinny426
      Brass Contributor

      Thanks for your help Riny, all working now.

      Richard.

  • Tinny426's avatar
    Tinny426
    Brass Contributor

    Hi, thanks for your suggestion, but it didn't seem to work. 

    Here is the full formula, which may help.

     

    =SORT(FILTER('******************* SEP 11-27'!A3:C239,'****************** SEP 11-27'!B3:B239="j"),3,-1)

    I need the results to include rows with both J and JJ in column B3:B239

    Thanks Rintinman.

    • Terio's avatar
      Terio
      Brass Contributor

      You have missed the double condition with +.
      You can try my solution also.

       

      Bye

      • Tinny426's avatar
        Tinny426
        Brass Contributor

        Thanks for you input Terio, its working now

        Richard.

  • Terio's avatar
    Terio
    Brass Contributor

    Another method, especially if you have more than two criteria to meet:

    =SORT(FILTER('******************* SEP 11-27'!A3:C239, ISNUMBER(MATCH('******************* SEP 11-27'!B3:B239, {"j";"jj"}, 0)), "NA"),3,-1)

    you can set up the matrix {"j";"jj"} with all strings you need.

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Tinny426​ Put each criterion between brackets and join them together with + for an OR, or * for an AND.

    If you want to check if B3:B241 contains either "j" or "jj" it could look like this:

    =FILTER( .........., (B3:B241="j")+(B3:B241="jj") )