# Creating a SumIF or Sum of Filtered Values

**URL:** <https://community.thunkable.com/t/creating-a-sumif-or-sum-of-filtered-values/1427227>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [August 3, 2021, 2:16am UTC](https://community.thunkable.com/t/creating-a-sumif-or-sum-of-filtered-values/1427227 "2021-08-03T02:16:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh.sprye](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@josh.sprye](https://community.thunkable.com/u/josh.sprye)\
**Post date:** [August 3, 2021, 2:16am UTC](https://community.thunkable.com/t/creating-a-sumif-or-sum-of-filtered-values/1427227/1 "2021-08-03T02:16:18Z")

</div>

Hi Thunkers,

I’ve been trying to figure something out for a few days with no luck so wanted to ask the community.

**What I’m trying to do:**  
From a list of values (stored as a local table), let’s call it a shopping list with category (fruit, pizza, etc) and prices per item. I want to create a second table that aggregates the total price for each category. In excel, this would operate as a sumif function (sumif category value is equal to ‘pizza’.)

 ![sn_20210802](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/1/b1fdbe39b17e39e3095f1f10ced0d696fc517007.jpeg)  
[Thunkable](https://x.thunkable.com/copy/a4e2b4d11cdc7c2226516b604094bb7d) (link expires 10/2/21)

**What I think I’m doing (going down the blocks):**

1. clearing my second table of any values
2. For each item in my clean list (this is a list of category values)
3. Set app variable objectcontainer to a row of data from my raw data table
4. If the category name is equal to j, build a list of prices from the raw data table
5. create a row in my second table that has category (j) and a sum of the list I created above

**Other topics I tried:**  
The topics I could find relate to summing a list, but I couldn’t find anything I could build on when it came to filtering a list prior to summing. Apologies of I missed a good string out there.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [August 3, 2021, 8:33am UTC](https://community.thunkable.com/t/creating-a-sumif-or-sum-of-filtered-values/1427227/2 "2021-08-03T08:33:10Z")

</div>

The first think I noticed is the `get row object from` is not supplied with any `row id` therefore everything else will fail.

---

<div class="post-metadata">

**Author:** ![josh.sprye](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@josh.sprye](https://community.thunkable.com/u/josh.sprye)\
**Post date:** [August 4, 2021, 8:04pm UTC](https://community.thunkable.com/t/creating-a-sumif-or-sum-of-filtered-values/1427227/3 "2021-08-04T20:04:17Z")

</div>

@muneer thank you for the nudge. I think I found a solution, pasted below after working through your advice.

Though, I’d open it up to any thunkers. Is this the best way to accomplish a sumif? Is there a more efficient way?

Thanks

 ![sn20210804](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/e/0e957fc50a27fdb99833e3ef560af482b9e14ee8.jpeg)

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:17pm UTC](https://community.thunkable.com/t/creating-a-sumif-or-sum-of-filtered-values/1427227/4 "2024-11-08T13:17:37Z")

</div>


