Advanced formula tricks

Counting stuff

Notion does not really understand the concept of a 'list', instead it gives you comma-separated strings. To do stuff with it, you're mostly required to use regular expressions.

Simple count

_ simple count

FooTagsCount
0
x
2
xy
4
xyz
6

Count formula → (prop("Tags") == "") ? 0 : (length(replaceAll(prop("Tags"), "[^,]", "")) + 1)

Explanation: it counts the commas, with a special case for the empty string. Tags can't contain commas so it will always work.

Count specific tags or words

_ count specific users

_ count specific

NameuserstypesCount beepCount boop
beep
3
9
beepboop
6
6
boop
9
3

Count formula → length(replaceAll(replaceAll(prop("YOUR PROP HERE"), "YOUR WORD HERE", "☃"), "[^☃]", ""))

Explanation: it replaces all mentions of "beep" with a random symbol (in this case, a snowman ☃), and then removes all characters that aren't snowmen. The length of the resulting string is the count we're looking for.

Note: only works if the words are not substrings of eachother. Potentially you can make some more complex regex to work around this.