Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

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

Topic Labels: Formulas
Solved
Jump to Solution
203 1
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

1 Solution

Accepted Solutions

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"
)

See Solution in Thread

1 Reply 1

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"
)