FormulaCraft

How to sum a range ignoring blanks in Excel and Google Sheets

Topic:SUM & aggregation
Excel & Google Sheets
=SUMIF(A2:A6,"<>",B2:B6)

Verified example

Computed by a real spreadsheet engine on the sample data below.

LabelValue
Alpha100
50
Beta200
Gamma80
30

=SUMIF(A2:A6,"<>",B2:B6)380

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Identify the column that should be non-blank (e.g. column A, the category column) and the column to sum (e.g. column B).
  2. 2Enter =SUMIF(A2:A6,"<>",B2:B6). The "<>" criteria means "not equal to empty", so only rows with a value in column A are included.
  3. 3Press Enter. Rows where A is blank are excluded from the B total.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

What is the difference between "<>" and "<>"""?

In SUMIF criteria, "<>" and "<>""" are equivalent — both mean not equal to an empty string.

How do I sum cells in B that are themselves non-blank?

=SUMIF(B2:B6,"<>") with only two arguments works because when the sum range is omitted SUMIF uses the criteria range as the sum range.

More on SUM & aggregation

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: