Is there any way I can do countifs() function...

Is there any way I can do countifs() functions directly in AppSheet. I need to count something based off of 3 criteria. For example, I need a formula that examines the following sheet and gives me a running count based off of 3 columns.

  1. a specific user (i.e. useremail())

  2. a specific type of service (i.e. Type 1) 3. has a specific status (i.e. Pending).

Iโ€™ve tried using the count(select(in())) function in a virtual column, but I can only get it return a single column of data, or compare a single โ€œvalueโ€ when counting. I canโ€™t seem to nest it with โ€œif()โ€ or โ€œand()โ€. Any ideas?

Thanks!

0 5 3,635
5 REPLIES 5

tony1
New Member

@Administrator1 Thereโ€™s no COUNTIF in AppSheet, but you can use a COUNT(SELECT(โ€ฆ)) formula. See this app for an example: appsheet.com - SUMIF and COUNTIF - This app shows how to do SUMIFs and COUNTIFs in AppSheet

More info here: https://help.appsheet.com/expressions/expression-types/list-expressions-and-aggregates SUMIF and COUNTIF - This app shows how to do SUMIFs and COUNTIFs in AppSheet appsheet.com

tony1
New Member

As a starting point, youโ€™ll want something like

COUNT(SELECT(YourTable[Key Column], AND([Column1] = โ€œsome valueโ€, [Column2] = "another value)))

I tried using the Count(Select()) method outlined in the example application, but it doesnโ€™t work properly for my purpose (unless Iโ€™m missing something). The Count(Select()) method only compares a single range and criteria, not multiple. For instance, I need a formula that does the following in Excel: COUNTIFS([Username],USEREMAIL(),[Service Type],โ€œType 2โ€,[Status],โ€œPendingโ€). COUNTIFS, unlike COUNTIF, allows you to use multiple criteria ranges and values to create a count.

Hereโ€™s a link to the function: support.office.com - COUNTIFS function - Office Support

COUNTIFS function - Office Support support.office.com

Hi, did you get the solution to COUNTIFS()? Iโ€™m having the same problem

Welcome to the AppSheet Community!

I believe that you can use a combination of IFS(), COUNT() and SELECT() functions like so:

IFS(
<criteria1>, COUNT(SELECT(...)),
<criteria2>, COUNT(SELECT(...)),
<criteria3>, COUNT(SELECT(...)),
<criteria4>, COUNT(SELECT(...)),
true, <default value or expression>
)

The criteria can be expressions returning Yes/No results like AND(), OR(), IN(), etc.

When using IFS(), I strongly recommend using a default value of some sort as shown. It can save you some troubleshooting grief later.


Top Labels in this Space