Excel Function: COUNTIFS

The COUNTIFS function applies criteria to cells across multiple ranges and counts the number of times all criteria are met (the COUNTIF function is limited to a single criteria).


=COUNTIFS(Criteria_range1, Criteria1)


=COUNTIFS(Criteria_range1, Criteria1, Criteria_range2, Criteria2, ...)

Example of use

The goal here is to first calculate the number of unpaid invoices (= 1 criteria) and then the number of overdue unpaid invoices (= 2 criteria):

excel countif unpaid countifs

Enter into the COUNTIFS function:

The formula is therefore here:

excel countifs empty
Since there is only one criteria, the COUNTIF function could have also been used here.

To then get the number of overdue unpaid invoices, a second criteria must be added to the formula which will check if the payment deadline has passed (i.e., a date smaller than TODAY):

excel countifs date today
If needed, you can download the Excel file used here: countifs.xlsx