Excel Function: SUMIF

The Excel function SUMIF allows you to perform a sum taking into account a criteria.

Usage:

=SUMIF(range, criteria)

or (if the range for the sum is different from the criteria range)

=SUMIF(range, criteria, sum_range)


Usage Example

The goal here is to calculate the total of unpaid amounts.

excel function sumif unpaid

To differentiate between paid and unpaid amounts, we will check if the payment date is filled in or not.

To do this, click on cell C10 and select the SUMIF function:

=SUMIF(D2:D8,"",C2:C8)

sumif function png

Click OK.

In this case, Excel will sum all the amounts for which the payment date is blank.

excel function sumif total

To get the total of paid amounts, you can use the same formula replacing the "" (empty) criteria with the opposite "<>" (not empty) criteria:

=SUMIF(D2:D8,"<>",C2:C8)
sumif function2

To get:

sumif
If needed, you can download the Excel file used here: sumif.xlsx
If you need to add additional criteria, use the SUMIFS function.