Forum Discussion

roy verdonschot's avatar
roy verdonschot
Copper Contributor
Sep 18, 2018

IFS(OR(ISNUMER(SEARCH( function

Is there a way to simplify this part of my IFS function:

 

IFS(OR(ISNUMBER(SEARCH("aanvraag opleiding",F619)),ISNUMBER(SEARCH("Aanvraag cursus",F619)),ISNUMBER(SEARCH("Toekenning aanvraag",F619)),ISNUMBER(SEARCH("Inschrijving opleiding",F619)),ISNUMBER(SEARCH("Coachingstraject",F619)),ISNUMBER(SEARCH("Volgen cursus",F619))),"Opleiding/training/coaching";...........................


It goes on after this and I have more of these repeated ISNUMBER(SEARCH( functions as logical tests and want to shorten them.

  • Philip West's avatar
    Philip West
    Steel Contributor

    Are you testing to see if any of those words show up in F619?

     

    How about creating a list of words to check and then using match as your logic..

     

    Something like, =if(isnumber(match(F619,Sheet2!$A$2:$A$10,0)),True,False)

     

    even better would be to make it a table or named range. This would also have the advantage of making it really easy to add/change/remove things to search for at a later date.

     

    • roy verdonschot's avatar
      roy verdonschot
      Copper Contributor

      Yes, that's what I'm testing. I like the idea, but I have to find the words in a bigger line of text within F619.

      • Philip West's avatar
        Philip West
        Steel Contributor

        Ah. Try this then..

        =or(if(isnumber(search(Sheet2!A2:A10)),F619,True,False))

         

        You need to enter it as an array ctrl+shift+enter..

Resources