Skip to content

Instantly share code, notes, and snippets.

@Nigtellios
Last active August 20, 2023 23:00
Show Gist options
  • Save Nigtellios/647336b9c858c67748c98f2dcd37028c to your computer and use it in GitHub Desktop.
Save Nigtellios/647336b9c858c67748c98f2dcd37028c to your computer and use it in GitHub Desktop.
Notion Formulas

If field with percent value > 0, subtract % from field or show other field.

if(
	prop("PERCENT") > 0,
	subtract(
		toNumber(prop("VALUE A")),
		multiply(divide(prop("PERCENT"), 100), toNumber(prop("VALUE A")))
	),
	prop("VALUE B")
)

Converting to Notion notations:

if(prop("PERCENT") > 0,subtract(toNumber(prop("VALUE A")),multiply(divide(prop("PERCENT"), 100), toNumber(prop("VALUE A")))),prop("VALUE B"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment