# Balance issue when a category is multiple times available

**URL:** <https://connect.superhuman.com/t/balance-issue-when-a-category-is-multiple-times-available/10237>\
**Category:** Ask the Community\
**Created:** [September 4, 2019, 12:09pm UTC](https://connect.superhuman.com/t/balance-issue-when-a-category-is-multiple-times-available/10237 "2019-09-04T12:09:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jean\_Pierre\_Traets](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jean_pierre_traets/32/16275_2.png) [@Jean\_Pierre\_Traets](https://connect.superhuman.com/u/Jean_Pierre_Traets)\
**Post date:** [September 4, 2019, 12:09pm UTC](https://connect.superhuman.com/t/balance-issue-when-a-category-is-multiple-times-available/10237/1 "2019-09-04T12:09:38Z")

</div>

Continued on the doc “Pantry n’ Recipes” - [Formula Help - Getting a bulleted list from 2 tables and one condition](https://connect.superhuman.com/t/formula-help-getting-a-bulleted-list-from-2-tables-and-one-condition/10208/6)

https://coda.io/embed/fEbpBBe0nf/_su4Qs?viewMode=embedplay&hideSections=true
## **My question: ❓**

Like below with the sample of the eggs:

For the “Hard Boiled Eggs” have been 10 orders of 2 egg/ recipe = 20 eggs

For the “Magic EGGS” have been 10 orders of 1 egg/ recipe = 10 eggs

This makes that have been used a total of **30 eggs**

As you can see in the table below I have one balance of 30 eggs and another one of 40 eggs

**Where did I go wrong? 🙄**

---

<div class="post-metadata">

**Author:** ![Filmos](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/filmos/32/9322_2.png) [@Filmos](https://connect.superhuman.com/u/Filmos)\
**Post date:** [September 4, 2019, 12:32pm UTC](https://connect.superhuman.com/t/balance-issue-when-a-category-is-multiple-times-available/10237/2 "2019-09-04T12:32:41Z")

</div>

If I understand correctly, you need to replace column `SumPurchased` with a column `Balance before recipe`.  
In current configuration the `Balance` column doesn’t account for other recipes that were used earlier that day.

---

<div class="post-metadata">

**Author:** ![Jean\_Pierre\_Traets](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jean_pierre_traets/32/16275_2.png) [@Jean\_Pierre\_Traets](https://connect.superhuman.com/u/Jean_Pierre_Traets)\
**Post date:** [September 4, 2019, 1:32pm UTC](https://connect.superhuman.com/t/balance-issue-when-a-category-is-multiple-times-available/10237/3 "2019-09-04T13:32:12Z")

</div>

Dear @Filmos,

Thanks for your time 🤝  
Sounds like a great idea, any suggestion to accomplish that?

---

<div class="post-metadata">

**Author:** ![Filmos](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/filmos/32/9322_2.png) [@Filmos](https://connect.superhuman.com/u/Filmos)\
**Post date:** [September 4, 2019, 2:08pm UTC](https://connect.superhuman.com/t/balance-issue-when-a-category-is-multiple-times-available/10237/4 "2019-09-04T14:08:32Z")

</div>

Here you go:  
https://coda.io/embed/H7zagxqmQd?viewMode=embedplay  
There are some ways in which this could be made significantly faster, but this what I came up with first.

---

<div class="post-metadata">

**Author:** ![Jean\_Pierre\_Traets](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jean_pierre_traets/32/16275_2.png) [@Jean\_Pierre\_Traets](https://connect.superhuman.com/u/Jean_Pierre_Traets)\
**Post date:** [September 4, 2019, 3:24pm UTC](https://connect.superhuman.com/t/balance-issue-when-a-category-is-multiple-times-available/10237/5 "2019-09-04T15:24:39Z")

</div>

Dear @Filmos

It’s impressive, thank you so much for your support, as I don’t have _(yet)_ this skill level 🤝  
_When I see the formula, I can get the logic, now it’s the challenge for me to learn to find such solution on my own._ 👓

**It’s showing again how valuable the input in communities like this, are 💭**
