Subtract values from a list
The list-subtract operator (-) will produce a new list with the values of the left-side list that are not present in the right-side list. The values of the resulting list will be in the order they occurred in the original left-side list.
Duplicate result entries will be omitted.
({ 1, 2, 3 } - LIST(2, 3, 4))produces a list of oneNumbervalue:1. See also:LIST()
({ "Bob", "Mary", "Bob", "Alice" } - { "Alice" })produces a list ofTextvalues:Bob,Mary. In addition to the requested removal ofAlice, note the duplicate occurrence ofBobwas also omitted from the result.
({ "Bob", "Mary", "Bob", "Alice" } - LIST())produces a list ofTextvalues:Bob,Mary,Alice. Note that the duplicate occurrence ofBobwas omitted from the result. Equivalent toUNIQUE({ "Bob", "Mary", "Bob", "Alice" }). See also:UNIQUE()
({ "Bob", "Mary", "Bob", "Alice" } - { "Bob" })produces a list of Text values:Mary,Alice. Note that althoughBobonly occurs once in the right-side list, both (all) occurrences ofBobfrom the left-side list are removed in the result.
See also
Was this helpful?
How can we improve it?