# Can we create an array COUNTIFs formula within Glide

**URL:** <https://community.glideapps.com/t/can-we-create-an-array-countifs-formula-within-glide/22714>\
**Category:** Ask for Help\
**Created:** [February 13, 2021, 6:18am UTC](https://community.glideapps.com/t/can-we-create-an-array-countifs-formula-within-glide/22714 "2021-02-13T06:18:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nelnhf](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nelnhf/32/21303_2.png) [@nelnhf](https://community.glideapps.com/u/nelnhf)\
**Post date:** [February 13, 2021, 6:18am UTC](https://community.glideapps.com/t/can-we-create-an-array-countifs-formula-within-glide/22714/1 "2021-02-13T06:18:31Z")

</div>

Hi all, I would like to create an array countif formua within Glide. Basically, I want to count the number of rows that meet 2 requirements for each user (row).  
I can’t do this in GSheets as the IFs requirements use LOOKUP data that is in Glide’s data editor and not in GSheets.

Looking forward to any advice. Thank you.

---

<div class="post-metadata">

**Author:** ![Manan\_Mehta](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manan_mehta/32/13957_2.png) [@Manan\_Mehta](https://community.glideapps.com/u/Manan_Mehta)\
**Post date:** [February 13, 2021, 6:26am UTC](https://community.glideapps.com/t/can-we-create-an-array-countifs-formula-within-glide/22714/2 "2021-02-13T06:26:37Z")

</div>

Have you tried using Rollup column based on a relation in Glide?

---

<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:** [February 13, 2021, 6:27am UTC](https://community.glideapps.com/t/can-we-create-an-array-countifs-formula-within-glide/22714/3 "2021-02-13T06:27:27Z")

</div>

Here is one way to do that:

- Create a template column that concatenates the values in every row of the two columns you are interested in. For example, lets say its a User table and you are interested in Age & Sex, then your template column would be something like ‘Age:Sex’, and then substitute the actual values in each row
- Next create a similar template column, but using the actual values you need to count. Again, for example, lets say you are looking for 10 year old males, then it would be “10:Male”
- Now create a multi-relation joining those two template columns
- Finally, create a rollup column counting the items in that multi-relation

---

<div class="post-metadata">

**Author:** ![profechef](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/profechef/32/221_2.png) [@profechef](https://community.glideapps.com/u/profechef)\
**Post date:** [February 13, 2021, 12:14pm UTC](https://community.glideapps.com/t/can-we-create-an-array-countifs-formula-within-glide/22714/4 "2021-02-13T12:14:17Z")

</div>

Here you have a [demo app](https://fair-soup-4096.glideapp.io/) implementing @Darren_Murphy idea in a dynamic way: you can select which age and which sex you want to count

---

<div class="post-metadata">

**Author:** ![nelnhf](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nelnhf/32/21303_2.png) [@nelnhf](https://community.glideapps.com/u/nelnhf)\
**Post date:** [February 14, 2021, 7:24am UTC](https://community.glideapps.com/t/can-we-create-an-array-countifs-formula-within-glide/22714/5 "2021-02-14T07:24:30Z")

</div>

Thanks guys. This is a good direction to move in. Will try it out and update!
