Welcome to Function Friday. This week we’ll explore Microsoft’s SharePoint List Function “OR” function. This function will return Yes if any of the arguments are True. If any of them are False, it will return No
Limitations
- Max 30 conditional values
Arrays
- OR operations can be performed in bulk if you have an array with elements. For example,
=OR({TRUE, FALSE})
will returnYes
- You can’t perform operations within the array-like
=OR({TRUE,1=1})
or nest them=OR({TRUE,OR({TRUE,1=1})})
References
- References to tables can also be evaluated like
=OR([isActive])
- You can combine references like
=OR([isActive], True)
.[]
identify the reference to the table, but they are not necessary if the name doesn’t contain spaces. So you can write the same formula like=OR(isActive, True)
Text
- OR is case insensitive, so
OR("TrUe")
orOR("True")
is evaluated to Yes - ORis language-specific, so
OR("Falso")
(False in Portuguese) will return the “#Value!” error.
Operations
- You can do
=OR(1=2)
where you can define the comparison that you want like <, >, <=, >= or <> - Arithmetic operations are also possible like
OR(1+1=2)
- You can nest like
=OR(1<2,OR(1<2,TRUE))
- You can combine with other operators like AND
=OR(1<2,AND(1<2,TRUE))
Recommendations:
- Avoid complex formulas. In the end. If you get a “#Value!” error, it will be hard to debug what is the condition that is generating the error.
- If possible, test the conditions one by one to see if you’re getting the desired results. Only after you’re sure that all of them are correct, join them into a big list of conditions. By doing this, you are sure that each of them is returning the desired value.
- I recommend no more than ten conditional values. Although SharePoint supports up to 30, it will become an unmanageable mess to debug complex formulas.
Sources:
Back to the SharePoint’s list formula reference.
Featured Image by Kevin Butz on Unsplash