Different calculation for each cells

Hi everyone!
I was wondering if it was possible to have a different formula in each cells from the same column?


What’s your specific use case for this?

I’m building an app for a 14 days nutrition program.
In my recipes, I’m showing the ingredients quantity based on the users daily energy intake (kcal)
For some recipes, I need to adapt the quantity for specific ingredients.
So I wanted to be able to have different formula in each ingredient row as it’s not always the same formula to be applied

Do you have specific examples of formulas and what would be different between rows? The short answer is no you can’t have different formulas…but the long answer is that almost anything is possible with some creativity.

1 Like


Ok so what’ I am trying to do is the following:

In the nutrition plan, my ingredients are divided in different tabs per meal and per macros.
F.i: 1 tab “Ingredients Proteins Lunch” “Ingredients Carbs Lunch” "Ingredients “Fat Lunch”

The quantity of the ingredients from these tabs are calculated based on total Kcal a user can intake per day. That info is in the “User” tab. So for the Quantity columns in these tabs, I simply used a math column and applied the same formula to all the rows.

But the quantities of some other ingredients are not calculated following the same formula.
Let take a real example.

The recipe is "Pancake with Avocado"

    • "Buckwheat flour" is in the “Ingredients Carbs Lunch”, and follow the normal formula: (100 User Quantity of Carb Lunch) / Carbs quantity for 100g of ingredient.*
    • "Egg white" is in the “Ingredients Proteins Lunch” and follow the normal formula: (100 User Quantity of Protein Lunch) / Protein quantity for 100g of ingredient.*

But for the macros fat. I have 2 ingredients: Avocado and Coconut oil.
So I put a row for avocado and one for coconut oil in the “Ingredients Fat Lunch” but in the math column to calculate the quantity, for this recipe, I can"'t follow the same formula as the other recipes as I would like to divide the quantity of fat a user can intake for lunch by 2 and then calculate the quantity of each ingredients accordingly.

Please let me know if it’s not clear

I’m a visual person, so I’m trying my best to understand. But I’m guessing you could have some type of rollup column that counts the number of fats If you have one fat, then the rollup should return 1. If you have two fats, then the rollup should return 2. Add a division to your math column formula that will divide by the rollup value.

1 Like