## Find empty cells and sum cells above

*Article last updated on October 25, 2017*

Is it possible to quickly select all empty cells and then sum cells above to next empty cell?

Can I have a formula in grand total (row 18) that only sums all the totals above?

### Instructions

Select all values and the blank total cells.

Press F5 or go to tab "Home" on the ribbon, click on "Find & Select" button and then click on "Go To.."

Click on "Special..." button.

Click on "Blanks" and then on "OK" button.

Go to tab "Home" on the ribbon and click on "AutoSum" button.

All empty cells now have a SUM formula that adds all above values to the next SUM formula.

Select cell C18 and type this formula:

Press Enter. Copy cell C18 and paste to cell range D18:F18.

### Explaining formula in cell C18

ISFORMULA(C3:C17) checks if a cell in cell range C3:C17 has a formula. It returns TRUE or FALSE.

ISFORMULA(C3:C17) returns this array: {FALSE; FALSE; TRUE; FALSE; FALSE; FALSE; TRUE; FALSE; FALSE; TRUE; FALSE; FALSE; FALSE; FALSE; TRUE}

The picture below shows this array in column D.

The array shows that there is a formula in C5, C9, C12 and C17.

ISFORMULA(C3:C17)*C3:C17 multiplies the boolean values with their corresponding values in column C, shown in column E below.

The SUMPRODUCT function then sums all values in the array. Why not use the SUM function? You need to enter it as an array formula if you use the SUM function.

### Download excel *.xlsx file

Sum values between two dates and based on a condition

In this post, I will provide a formula to sum values in column (Qty) where a column (Date) meets two […]

This article describes how to count unique distinct values. What are unique distinct values? They are all values but duplicates are […]

Count how many times a string exists in a cell range (case insensitive)

Question: How do I count how many times a word exists in a range of cells? It does not have […]

Count text string in a range (case sensitive)

Question: How do I count the number of times a text string exists in a column? The text string may […]

Count overlapping days in multiple date ranges

The MEDIAN function lets you count overlapping dates between two date ranges. If you have more than two date ranges […]

Formula for matching a date within a date range

Table of contents Match a date when a date range is entered in a single cell Match a date when […]

Identify overlapping date ranges

The formula in cell F6 returns TRUE if the date range on the same row overlaps another date range in […]

Overview This article describes how to create a random playlist of four teams total. Column A contains four teams. Each […]

Running totals within date range

Andrew asks: LOVE this example, my issue/need is, I need to add the results. So instead of States and Names, […]

Dynamic team generator in excel

Mark G asks: 1 - I see you could change the formula to have the experssion COUNTIF($C$1:C1, $E$2:$E$5)<5 changed so […]

### 4 Responses to “Find empty cells and sum cells above”

### Leave a Reply

### How to comment

**How to add a formula to your comment**

<code>Insert your formula here.</code>

**Convert less than and larger than signs**

Use html character entities instead of less than and larger than signs.

< becomes < and > becomes >

**How to add VBA code to your comment**

[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

**How to add a picture to your comment:**

Upload picture to postimage.org or imgur

Use the img tag, like this: <img src="Insert pic link here">

**Contact Oscar**

You can contact me through this contact form

As alternative solution in cell C18 you can write the formula

`=SUM(C3:C17)/2`

miho66,

Yes, you are right. A lot easier, thanks for commenting.

Another complete this task:

after use autosum, select again whole range (C3:F17) and use Find&Replace to replace sting "sum(" with "subtotal(9,"

Ciprian Stoian,

Yes, you are right. The SUBTOTAL function ignores other SUBTOTALS to avoid double counting.

Thank you for commenting.