Table of Contents
To sum cells in Google Sheets if they are not blank, you can use the SUMIF function. This function allows the user to add up values in a range of cells based on a condition. In this case, the condition is that the cell is not blank. This allows the user to add up all the values that are not empty in a column or range of cells. The syntax for the SUMIF formula is =SUMIF(range, criteria, sum_range).
You can use the following basic formula to sum cells in a range that are not blank in Google Sheets:
=SUMIFS(sum_range, criteria_range, "<>")
This formula sums the values in the sum_range where the corresponding values in the criteria_range are not blank.
The following example shows how to use this formula in practice:
Example: SUMIF Not Blank in Google Sheets
Suppose we have the following dataset in Google Sheets that shows the points scored by 10 different basketball players:
We can use the following formula to sum the values in the Points column only if the corresponding value in the Player column is not blank:
=SUMIFS(B2:B11, A2:A11, "<>")
The following screenshot shows how to use this formula in practice:
The sum of the points in column B where the player in column A is not blank is 45.
We can manually verify this by taking the sum of the points where the player value is not blank:
- Sum of Points: 4 + 5 + 5 + 10 + 10 + 5 + 6 = 45
Note that we could also use the following formula to only sum the points values where the player name is blank:
=SUMIFS(B2:B11, A2:A11, "")
The following screenshot shows how to use this formula in practice:
The sum of the points in column B where the player in column A is blank is 25.
We can also manually verify this by taking the sum of the points where the player value is blank:
- Sum of Points: 8 + 12 + 5 = 25