Search

let() and lets() | Beginner’s Guide to Notion Formula

post type
tutorial
notion
formula
status
published
author
created time
2024/10/23 09:51
description
Discover how to streamline your Notion formulas with the powerful let() and lets() functions. This comprehensive guide provides an in-depth breakdown of each function, including their structures, how they work, and practical examples that illustrate their capabilities. Enhance your productivity and clarity in data management by mastering these essential Notion formula features.
cover image
Frame 11.png
1 more property

This is your sign to try let() and lets()

Two notable functions within Notion's formula ecosystem are let() and lets(). These functions enable users to simplify their calculations and make complex formulas more manageable. In this blog post, we will explore the structure of both functions, break down how they work, and provide examples to illustrate their usage.
For this guide, I referenced the Notion Formula documentation and added my own examples and explanations.

Summary

Name
Syntax
Description
Example
let()
let(variable, value, expression)
Designed to define a temporary variable within a formula.
let(price, 150, price * 1.1) → this will output 165 (which is basically 150 x 1.1)
lets()
lets(variable1, value1, variable2, value2, ..., expression)
Designed to define multiple temporary variables within a formula.
lets(test1, 85, test2, 90, test3, 95, (test1 + test2 + test3) / 3) → this will output 90.

let() Formula

How let() works

The let() function is designed to define a temporary variable within a formula. Its syntax allows you to create a single variable that can be used in subsequent calculations or expressions.
Here's how you would write the formula statement in Notion:
let(variable, value, expression)
Notion Formula
복사
Breaking it down
variable: The name of the variable you're defining. (Do not enclose this in a quotation mark).
value: The value you want to assign to that variable.
expression: The formula or calculation that utilizes the defined variable.

Example of let()

Search
example
description
formula
results
Storing a variable using let()
let(price, 150, price * 1.1) - In this example: • The variable price is set to 150. • The expression then calculates price * 1.1.
165

lets() Formula

How lets() works

The lets() function, on the other hand, is used for defining multiple variables at once. This is particularly useful for complex formulas where you need to refer to several intermediate values.
The general structure of lets() is:
lets( variable1, value1, variable2, value2, ..., variablen, valuen, ..., expression )
Notion Formula
복사
Breaking it down
variable1, variable2, ...: Names of the variables you are defining. (Do not enclose this in a quotation mark).
value1, value2, ...: The corresponding values assigned to those variables.
expression: The final formula or calculation that uses the defined variables.

Example of formula

Search
example
description
formula
results
Storing multiple variable using lets()
lets(test1, 85, test2, 90, test3, 95, (test1 + test2 + test3) / 3) - In this case, test1test2, and test3 are defined with values of 8590, and 95 respectively. The formula then calculates (test1 + test2 + test3) / 3, yielding average score of 90.
90

Conclusion

The let() and lets() functions make formulas cleaner and easier to understand. If you have a repetitive calculation or value in the formula, be sure to use these functions.
Thank you for reading this tutorial! If you found it helpful, be sure to check out shop for my beautiful templates, which I am confident enough to say are a game-changer Subscribe to my newsletter and feel free to follow me on my social media for updates!
Happy Notion(ing)!
Search