I need help how to use "OR" and "IF" functions

Hi , I need help with this expression , I want to use "IF" function with "OR" function , but I don't know how ???

if(CONTAINS([Resulttext],"a"),"1", "Monday")
if(CONTAINS([Resulttext],"b"),"2", "tuesday")

Solved Solved
0 7 246
1 ACCEPTED SOLUTION

I'm not sure what results you are looking for, try

IFS(
   OR(
      CONTAINS([ResultText], "a"),
      CONTAINS([ResultText], "1")
   ),
      "Monday",
   OR(
      CONTAINS([ResultText], "b"),
      CONTAINS([ResultText], "2")
   ),
      "Tuesday",
   TRUE,
      "???"
)

or

IF(
   OR(
      CONTAINS([ResultText], "a"),
      CONTAINS([ResultText], "1")
   ),
      "Monday",
      IF(OR(
               CONTAINS([ResultText], "b"),
               CONTAINS([ResultText], "2")
            ),
         "Tuesday", "???")
)

View solution in original post

7 REPLIES 7

OR() - AppSheet Help
IF() - AppSheet Help

Just place your OR inside the first argument of IF

I'm not sure what results you are looking for, try

IFS(
   OR(
      CONTAINS([ResultText], "a"),
      CONTAINS([ResultText], "1")
   ),
      "Monday",
   OR(
      CONTAINS([ResultText], "b"),
      CONTAINS([ResultText], "2")
   ),
      "Tuesday",
   TRUE,
      "???"
)

or

IF(
   OR(
      CONTAINS([ResultText], "a"),
      CONTAINS([ResultText], "1")
   ),
      "Monday",
      IF(OR(
               CONTAINS([ResultText], "b"),
               CONTAINS([ResultText], "2")
            ),
         "Tuesday", "???")
)

Great it works... thank  you

I guess you would like to get days name from date, better use TEXT([Date], โ€œDDDDโ€)

DDD short name of the day of the week (Wed) 

DDDD long name of the day of the week (Wednesday)

https://support.google.com/appsheet/answer/10107701?hl=en

hi

OR work likes AND but different

OR(

If(Contains([Resulttext],"a"),"1","Monday"),

If(Contains([Resulttext],"b"),"2","Tuesday")

)

 

 

Thank you for reply ... but I get this message error :

Condition OR(IF(CONTAINS([Resulttext],"a"),"1","Monday"), IF(CONTAINS([Resulttext],"b"),"2","Tuesday")) has an invalid structure: subexpressions must be Yes/No conditions

Apologies. I was meant to start with and() not or(). But realise now from the solution I misunderstood what you were trying to do from your original post. 

Top Labels in this Space