Go Back

Add Cells Based on Blank / Not Blank Criteria

Using Excel SUMIF function you can sum the numbers from a range of cells that meet the criteria based on cells that do not contain any value (Blank) or cells that are contain a value (Not Blank).

While working with data you come across to a situation where you need to sum numbers based on these two criteria. Each of these criteria can be tested on data range or sum_range as per SUMIF syntax.

=SUMIF (range, criteria, sum_range)

In this article, suppose you have a data set of sales orders of various products with their amounts and delivery dates, and some of the dates are missing (Blank) and some are delivery dates are provided (Not Blank) in Delivery Date field.

SUMIF Blank cells

Here, you will learn how to sum numbers based on blank cells criteria. In this example you need to sum Amounts where delivery dates are not mentioned in Delivery Date field. Criterion is supplied as double quotation marks without any space in-between, such as “”.

=SUMIF(D2:D11,"",C2:C11)

This criteria implies to all those cells that contain zero character length, means empty. If a cell contains any space, then it will not meet criteria and it will be considered as Non Blank cell.

This formula will sum all those amounts in range C2:C11 where cells are Blank in range D2:D11.

Here, you can see SUMIF function has sum the numbers (Amount) from range specified as sum_range, where cells in specified range do not contain a value (Delivery Date).

SUMIF Non Blank cells

Using SUMIF function you can sum numbers based on Non blank cells criteria. In our examples, you need to sum Amounts where delivery dates are mentioned in Delivery Date field.

Criteria in SUMIF function is supplied by using one of comparison operators Not Equal to (<>), means not equal to blank, in double quotation marks, such as “<>”.

=SUMIF(D2:D11,"<>",C2:C11)

This formula will sum all those amounts in range C2:C11 where cells are Not Blank in range D2:D11. Criteria implies to all those cells that contain at least one character length, means not empty. If a cell contains even a space, then it will meet criteria and will be considered as Non Blank cell.

SUMIF function will sum the numbers (Amount) in specified sum_range where criteria is met for Non Blank cells in Delivery Date field, specified as range as per syntax.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

Hello. I am looking to create a running balance in a column on an excel spreadsheet for an accounting bank statement, however I only want the balance to be calculated when the cells to be considered are not blank. I have tried sumif and sumifs but can't get either to work. This is what I am trying to achieve: Opening Balance C2 + Debit A3 - Credit B3 New Balance C3 = C2 + A3 - B3 (but only if A3 and B3 are not blank, if they are blank then the balance for that row to be left blank too).
Solved by K. H. in 21 mins
For each cell in I5:Z202 When Category=Label, and Credit is blank enter Amount. When Category=Label and Credit is not blank enter -Amount Otherwise leave cell blank
Solved by I. U. in 21 mins
I need to write if S is blank then T but if not blank then S
Solved by V. U. in 15 mins

Leave a Comment

avatar