# Arrayformula: COUNTIF / COUNTIFS

**URL:** <https://community.glideapps.com/t/arrayformula-countif-countifs/17656>\
**Category:** Ask for Help\
**Created:** [October 27, 2020, 2:57pm UTC](https://community.glideapps.com/t/arrayformula-countif-countifs/17656 "2020-10-27T14:57:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GRobbins](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/grobbins/32/3924_2.png) [@GRobbins](https://community.glideapps.com/u/GRobbins)\
**Post date:** [October 27, 2020, 2:57pm UTC](https://community.glideapps.com/t/arrayformula-countif-countifs/17656/1 "2020-10-27T14:57:46Z")

</div>

=COUNTIF(Singles!$B$2:$C$74,A2)+COUNTIF(Doubles!$B$2:$F$96,A2)

Would like to have the above in an ARRAYFORMULA but it does not copy down the column as needed. The goal is to show total games played, whether in singles or doubles. I have tested various means, but nothing working in an array formula.

(Singles Tab)  
B Col - Home Player  
C Col = Away Player

(Doubles Tab)  
C Col - Home Player 1  
D Col = Away Player 1  
E Col - Home Player 2  
F Col = Away Player 2

Thanks in advance.

---

<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:** [October 27, 2020, 3:13pm UTC](https://community.glideapps.com/t/arrayformula-countif-countifs/17656/2 "2020-10-27T15:13:07Z")

</div>

When you had it in an arrayformula, did you have A2:A in place of A2? That should make it work with COUNTIF. I don’t believe COUNTIFS is compatible with arrayformulas.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [October 27, 2020, 3:13pm UTC](https://community.glideapps.com/t/arrayformula-countif-countifs/17656/3 "2020-10-27T15:13:11Z")

</div>

I think you can keep this in Glide Editor, make a multiple relation to singles tab using the player’s email, then return the total count using a rollup. Do the same for the doubles, then use a math to sum the two rollups.

---

<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:** [October 27, 2020, 3:14pm UTC](https://community.glideapps.com/t/arrayformula-countif-countifs/17656/4 "2020-10-27T15:14:22Z")

</div>

I agree with @ThinhDinh, This could be done in glide and would work much better.

---

<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:** [June 15, 2021, 1:52am UTC](https://community.glideapps.com/t/arrayformula-countif-countifs/17656/5 "2021-06-15T01:52:44Z")

</div>

> [@GRobbins](#):
>
> =COUNTIF(Singles!$B$2:$C$74,A2)+COUNTIF(Doubles!$B$2:$F$96,A2)

Not sure if you are still interested but I was looking for something similar…

Put in header row

```auto
={"totalGameCount";arrayformula(if(isblank(A2:A),"",COUNTIF(Singles!$B$2:$C,A2:A)+COUNTIF(Doubles!$B$2:$F,A2:A)))}

```
