# SUMIFS and advanced formulas

**URL:** <https://community.glideapps.com/t/sumifs-and-advanced-formulas/41472>\
**Category:** Ask for Help\
**Created:** [April 30, 2022, 6:49pm UTC](https://community.glideapps.com/t/sumifs-and-advanced-formulas/41472 "2022-04-30T18:49:49Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [May 3, 2022, 12:22am UTC](https://community.glideapps.com/t/sumifs-and-advanced-formulas/41472/5 "2022-05-03T00:22:20Z")

</div>

Hola,

there is a plan C if you want to go beyond to Jeff’s suggestion: JavaScript code

I know it’s not a “no code solution” but sometimes, not all can be “no code” 😉

Here my example: Imagine you want to have all values with _Date=“2021-Q1”_ and “_Expired=True_”, your table could look like this

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/a/1a3c0ae8c27a8f55610775ff17661077a9856f1f.png)

1. your JS code might be this, something short and able to save columns  

2. Later, we need to convert this result (text) to a numeric value using a Math column and get the Total (sum) by using a Rollup column.  

But let’s complicate the case!  
Imagine now we want to have the Total (Sum) associated to all Q1s no matter the year (2019/2020/2021-Q1) with “_Expired=True_”, so the JS code would be:

```auto
if ((p1=="2019-Q1" || p1=="2020-Q1" || p1=="2021-Q1") && p2==true)
   return p3

```

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/6/565f9d2820af1604185a041f294601dbad4e62c3.png)

and after converting the above result to a numeric value and use a rollup to sum values, your table will look like this:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/a/dafe6f3ef1745bed4f0e737fab4dc58fd5746805.png)

I hope it helps.

Saludos!

---

_[View the full topic](https://community.glideapps.com/t/sumifs-and-advanced-formulas/41472)._
