Can a formula field IF check if a value is in a list of values?

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • Answered
I have a formula field where I'd like to check if the value in a field is contained in a list of values
IF([Field1] in [1, 2, 5, 10], "Yes", "No")
Is this possible somehow?  If the value in Field1 is one of the values in my list (1, 2, 5, 10), then output "Yes", otherwise output "No"

Or do I need to put each line separately?
If([Field1] = 1, "Yes",
   [Field1] = 2, "Yes",
   [Field1] = 5, "Yes",
   [Field1] = 10, "Yes",
Photo of Mike


  • 474 Points 250 badge 2x thumb

Posted 5 months ago

  • 0
  • 1
You are safer with the IF and listing all the values lie you did in our example.  The "Contains" function is really for text values and you will get messed up between for example, 1 and 10 where they both contain a 1.

With numeric values you should use the formula you suggested where the conditions are listed vertically.