Notionize Consulting

Formulas 2.0 - Told through Meal Planner

27/05/2025 ·

Formulas 2.0 - Told through Meal Planner

Creating a Meal Planner template from scratch using Notion’s Formulas

Tags: Notion FormulasNotion TemplateTutorial

Welcome to my first blog post! In this series of Notion tips and tricks, we’ll be taking a look at the newly revamped Notion Formulas!

Notion has long been a part of my daily workflow, and them adding formulas has really extended the capabilities of databases. Here’s the official Notion documentation on their update.

With this in mind, let’s start out by trying to build a brand new diet tracker so we can mess around with these formulas. This template will compose of two different databases:

  • Diet planner
  • Meals
  • What we’ll look to do is track each day’s meals using the diet planner, and use the meal database to keep track of the specific properties like calories and price.

    At the end of this tutorial, we’ll have covered:

  • Basic formulas
  • Using variables with formulas
  • Checking out the outputs from various formulas
  • A database to track our diet!
  • We’ll start out by creating the skeletons for our databases. In the Diet planner database, we’re going to use the ‘@’ mentions to create pages for each specific day.

    Let’s also create a Meals database to hold our meals. In this database, we’ll need a couple of fields which are common for diet planning like calories and cost. I’ll add in some dummy data based on my recent diet trends (late overnight oats enjoyer here) and the databases should look something like this:

    Notion image

    Now that we have our databases set, let’s start creating some more dummy data and making sure we have our Meals properly populated so we can work with some values in our diet planner.

    Generally when we’re planning out our meals, we might not be buying amounts for just one portion. We’ll set up some basic formulas in our meals database to calculate the cost per serving of each of our meals to set up our diet planner easily. We’re also going to add an ingredients list which I’ll keep as a list of text for now, but feel free to expand on that in your own time.

    In it’s basic form, Notion formulas is pretty helpful with completing their own properties and most basic arithmetic operations are simple to use. We’ll use some simple ones to get our cost and calories per serving of each meal. Once you start typing out the name of each property, Notion helpfully autocompletes each field.

    Notion image

    Now on to the main part of the diet planner, we will calculate our calories consumed in a day using the related Meals database properties in our Diet Planner database. Let’s say that a particular day in our meal planner database, we ate some meals and related them using the relation from the Meals database. Now we want to count how many calories we consumed.

    We’ll create a new property named Calories for the Day as a formula type. In the formula bar, we’ll end up using:

    Let’s break this down:

  • prop("Meals").map(…) : From the relation property Meals, we are going to use the map function to get a list of the values we want
  • current.prop("Calories/Serving"): This gives us the Calories per Serving from our Meals database without us having to create another property to get the rollup as we would have had to do previously. The keyword ‘current’ is used to reference the property we’re looking to dive into. So in this case we went Meals → Calories/Serving.
  • Since we want the sum of these values, we wrap our results in a sum() function
  • Our database should now look a little something like this:

    Notion image

    Getting Comfy with Variables

    All right, we now have a pretty decent basic meal planner which uses some common formulas to get the calories we’ve consumed per day. However, this assumes that we have the same serving amount every time. Let’s change things up a bit and make our calorie counting a little more flexible. With this formulas update, you’ll notice that the Notion formulas box is now multi-line. They’ve now introduced a feature which allows you to define variables within the formulas box and use that variable within your formula to prevent repetition.

    For a start, we can add a formula which results in a check box for whether we’ve achieved a calorie goal for the day. I’ll make this check flip-able for those who want to keep themselves on a strict diet instead. This can be an if statement or a logical operator if you’re more familiar with javascript:

    One way we can use variables and to make this calorie counting a little more dynamic, would be to store our different meal servings into their own properties rather than together in one big list. This would make it easier for us to track the different servings of a particular meal we’ve had for a day rather than locking us into a set serving size each time. We’ll look to change our Calories for the Day field to now take into account the serving size of each meal by declaring a variable at the start of our formula to track this.

    In order to do this a bit more flexibly, we’re also going to add a field for which meal type each meal is (eg: Breakfast, Lunch or Dinner), setting our formula up to take into account the serving size of each meal taking into account its meal type. This will make the meals a bit more rigid but we’ll overlook that for the sake of this tutorial. In future cases I’d recommend relating each meal into their own field as a replacement for this so when you have Spaghetti Bolognese for dinner, you’re not caught out by this.

    Here’s the formula for what we end up with:

    It’s a meaty one so let’s break it down. We’re making use of the lets keyword which lets use define multiple variables within the same Notion formula, so we now can avoid adding a rollup to our database. This keyword expects arguments to come in pairs of 2 ending in a final argument of the logic you want to do with these variables

    Outside of that, we have the logic to separate out each meal type based on what it’s type is when we get the values from the Meals database using breakfast, prop("Meals").filter(current.prop("Type")=="Breakfast")

    We finally end up using the sum function to add all of these variables together, also having to dig slightly further because what we end up with is an array of these meals, so we have to use the map and current functions to access their calories per serving before finally multiplying by our serving size for each meal during the day.

    This can be further extended by adding other columns for other meals such as snacks or desserts.

    Conclusion

    With all of this done, we now have a nice diet tracking database which is ready for use and we have hopefully understood the new Notion formula capabilities a little better. If you have any questions or queries, feel free to leave a comment or sending me an email at notionizeconsulting@gmail.com

    If you’re interested in grabbing a copy of this diet planner with a little more frills, feel free to head over to my templates profile and copy one for your own workspace.