# How to Sum If Not Blank in Excel

To sum values in a range if the cells are not blank in Excel, you can use the SUMIF function. The SUMIF function allows you to add up values in a range based on a specified condition.

Here's how to use the SUMIF function to sum values if the cells are not blank:

- Open Microsoft Excel and enter your data in a range of cells.
- In a blank cell where you want to display the sum, type the following formula:=SUMIF(range,"<>",sum_range)In this formula:
`range`

is the range of cells you want to evaluate for the condition (not blank).`"<>"`

is the condition, which means "not equal to blank."`sum_range`

is the range of cells you want to sum. It should have the same number of rows and columns as the`range`

.

- Replace
`range`

and`sum_range`

with the appropriate cell references or named ranges in your worksheet. - Press Enter to complete the formula, and the sum of the non-blank cells in the specified range will be displayed in the cell.

## Example

Let's say you have the following data in cells A1:A7:

```
10
(blank cell)
20
30
(blank cell)
40
50
```

To sum the non-blank cells in this range, you can use the following formula:

`=SUMIF(A1:A7,"<>",A1:A7)`

After entering this formula in a blank cell, press Enter. The result will be 150, which is the sum of the non-blank cells (10 + 20 + 30 + 40 + 50).

Did you find this useful?