Search code examples
google-sheetsworksheet-function

Search a question mark


Could anyone help me with this?

I need a formula to do something like this:

     =sum(if(ISNUMBER(SEARCH("a?",B8)),15%,0%)+sum(if(ISNUMBER(SEARCH("a",$B8)),90%,0%)

The values in B8 will be a/a?/a so the result need to be 195%

Thank you in advance!


Solution

  • Create a table in column H with codes and I with values:

     =ARRAYFORMULA(SUM(VLOOKUP(SPLIT(B8,"/"), $H$1:$I$12,2,0)))
    

    EDIT:

    If question mark is the only differentiating point, then there's no need of a table. To search a question mark, you need to use ~ before the question mark:

     =ARRAYFORMULA(SUM(IF(ISERR(SEARCH("~?",SPLIT(B8,"/"))),90%,15%)))