Red Gregory

View Original

Notion Formulas: Locate And Count Document Extensions

PDF example

contains(prop("Files"), ".pdf") ? ((length(prop("Files")) - length(replaceAll(prop("Files"), "[.]pdf", ""))) / 4) : 0

  • contains(prop("Files"), ".pdf")

    • find the extension

  • ? ((length(prop("Files")) - length(replaceAll(prop("Files"), "[.]pdf", "")))

    • if the extension is found, subtract the total length of the file(s) from the length of the file without the extension.

  • / 4)

    • Divide above result by number of characters in extension (including “.”). For “.pdf” … the number would be 4.

General Syntax

contains(prop("Files"), ".NAME OF EXTENSION") ? ((length(prop("Files")) - length(replaceAll(prop("Files"), "[.]NAME OF EXTENSION", ""))) / NUMBER OF CHARACTERS INCLUDING (.) IN EXTENSION) : 0

Extensions Included In Template

  • PDF

  • MD

  • XLS

  • TXT

  • CSV

See this content in the original post

Copy Template In Notion!


See this gallery in the original post