# Sum if functionality - to sum values given a condition

**URL:** <https://community.glideapps.com/t/sum-if-functionality-to-sum-values-given-a-condition/62147>\
**Category:** Ask for Help\
**Created:** [May 25, 2023, 6:18pm UTC](https://community.glideapps.com/t/sum-if-functionality-to-sum-values-given-a-condition/62147 "2023-05-25T18:18:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacobkou](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacobkou/32/54763_2.png) [@Jacobkou](https://community.glideapps.com/u/Jacobkou)\
**Post date:** [May 25, 2023, 6:18pm UTC](https://community.glideapps.com/t/sum-if-functionality-to-sum-values-given-a-condition/62147/1 "2023-05-25T18:18:50Z")

</div>

Hey fellow gliders,

I am new to guide and need some advice on how to solve this problem.

I have a very basic data sheet

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/8/8837bc548db6e60f18837783469b83394d75f15a.png)

Essentially what I want to do is sum the total (which is quantity \* price ) of each fund using something similar to a sum if function. How would I do this. In this case for fund 1 the result of what I want should be (556+500+190=1246) and for fund 2 the result should be (100+500=600).

Thanks

---

<div class="post-metadata">

**Author:** ![Jacobkou](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacobkou/32/54763_2.png) [@Jacobkou](https://community.glideapps.com/u/Jacobkou)\
**Post date:** [May 25, 2023, 6:28pm UTC](https://community.glideapps.com/t/sum-if-functionality-to-sum-values-given-a-condition/62147/2 "2023-05-25T18:28:20Z")

</div>

I have got somewhere

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/7/1776e2927a41b6008ea47d7f22ecc36eabb1c8bb.png)  
using a relation I managed to filter out the correct “assets” but how do I only extract the funds?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [May 25, 2023, 6:36pm UTC](https://community.glideapps.com/t/sum-if-functionality-to-sum-values-given-a-condition/62147/3 "2023-05-25T18:36:45Z")

</div>

I would first add a math column to calculate the total on each line. Then you can add a Rollup column to sum that total through the relation.

---

<div class="post-metadata">

**Author:** ![Jacobkou](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacobkou/32/54763_2.png) [@Jacobkou](https://community.glideapps.com/u/Jacobkou)\
**Post date:** [May 25, 2023, 10:09pm UTC](https://community.glideapps.com/t/sum-if-functionality-to-sum-values-given-a-condition/62147/4 "2023-05-25T22:09:35Z")

</div>

can you explain that in more detail? total for what? Have I not already done that?

---

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [May 25, 2023, 10:15pm UTC](https://community.glideapps.com/t/sum-if-functionality-to-sum-values-given-a-condition/62147/5 "2023-05-25T22:15:00Z")

</div>

> [@Jacobkou](#):
>
> Have I not already done that?

It appears so… simply follow the rest of @Jeff_Hager instructions and use a rollup column via your relation named “Test” and target your “Total” column.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [May 25, 2023, 11:04pm UTC](https://community.glideapps.com/t/sum-if-functionality-to-sum-values-given-a-condition/62147/6 "2023-05-25T23:04:52Z")

</div>

My apologies. I somehow missed seeing the Total column in both of your screenshots. Been staring at the screen to long. 🤦

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [May 26, 2023, 3:02am UTC](https://community.glideapps.com/t/sum-if-functionality-to-sum-values-given-a-condition/62147/7 "2023-05-26T03:02:30Z")

</div>

Did you get this working?

I can’t see how your “Test” relation is configured, but it doesn’t look right from what I can see in the screen shot.

What you should be doing in that relation is matching the Fund column with itself.  
You can then do a Rollup → Sum → Total via the relation to get the result you’re after.

---

<div class="post-metadata">

**Author:** ![Jacobkou](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacobkou/32/54763_2.png) [@Jacobkou](https://community.glideapps.com/u/Jacobkou)\
**Post date:** [May 26, 2023, 12:10pm UTC](https://community.glideapps.com/t/sum-if-functionality-to-sum-values-given-a-condition/62147/8 "2023-05-26T12:10:42Z")

</div>

Got it working, used the videos on how to use relation and rollups and it made it crystal clear! Thanks guys!
