Google Sheets Function: COUNTIFS

The COUNTIFS function counts the number of cells that meet multiple criteria (unlike the COUNTIF function, which is limited to a single criterion).

Usage:

=COUNTIFS(criteria_range1, criterion1)

or

=COUNTIFS(criteria_range1, criterion1, criteria_range2, criterion2, ...)


Usage Example

The COUNTIFS function will be used here to first calculate the number of unpaid invoices (= 1 criterion) and then the number of unpaid and overdue invoices (= 2 criteria):

google sheets unpaid bills countifs

Enter the COUNTIFS function:

The formula here is:

=COUNTIFS(C2:C11,"")
google sheets countifs empty
Since there is only one criterion, the use of the COUNTIF function is also suitable.

To now obtain the number of unpaid and overdue invoices, add a second criterion to the formula that checks if the payment deadline is passed (so smaller than TODAY):

=COUNTIFS(C2:C11,"",B2:B11,"<"&TODAY())
google sheets countifs date today
If needed, you can copy the Google Sheets document (or view the document) with this example.
Tip: it is possible to use wildcard characters with this function.