Skip to main content
Solved

Can I use 'OR()' after '='?

  • May 24, 2021
  • 1 reply
  • 12 views

I wrote the codes as below:

IF({Priority of task} = OR("Emergency","Important","Urgent"), SWITCH({Days until deadline},3,"3️⃣",2,"2️⃣",1,"1️⃣",0,"‼️"),"This is not an important task")

But the result is that all tasks shows “This is not an important task” even the priority is emergency. I wonder is it due to the misuse of OR() in the formula? Can OR() be used like IF(… = OR(…, …, …) , … , … ) this way? Thanks.

Best answer by kuovonne

Welcome to the Airtable community!

Correct. Try this instead:

IF(
  OR(
    {Priority of task} = "Emergency",
    {Priority of task} = "Important",
    {Priority of task} = "Urgent" 
  ),
  SWITCH( {Days until deadline},
    3,"3️⃣",
    2,"2️⃣",
    1,"1️⃣",
    0,"‼️"
  ),
  "This is not an important task"
)

1 reply

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • Answer
  • May 24, 2021

Welcome to the Airtable community!

Correct. Try this instead:

IF(
  OR(
    {Priority of task} = "Emergency",
    {Priority of task} = "Important",
    {Priority of task} = "Urgent" 
  ),
  SWITCH( {Days until deadline},
    3,"3️⃣",
    2,"2️⃣",
    1,"1️⃣",
    0,"‼️"
  ),
  "This is not an important task"
)