Spreadsheet Practice

How to sum if a cell is not blank in Excel

Formula (Excel and Google Sheets)

=SUMIFS(B2:B8,C2:C8,"<>")

Use "<>" (not equal to nothing) as the condition: =SUMIFS(B2:B8,C2:C8,"<>") adds the rows where column C has something in it.

Result on the example
153.75 in F1
Works in
Every current version
Google Sheets
Same formula

See it work

The formula is already in F1. Change any input and the result updates, or edit the formula to experiment.

How it works

The condition "<>" means "not equal to empty", so SUMIFS adds the hours on rows where C2:C8 holds a name. Rows with no approver are skipped. SUMIFS puts the range to add first, so you can add more conditions after it.

=SUMIFS(B2:B8,C2:C8,"<>")

Result153.75

  1. B2:B87 rows × 1 col: 38.50, 41.00, 36.00, 40.00, …

    A range: 7 cells in one column.

  2. C2:C87 rows × 1 col: "M. Ruiz", (empty), "M. Ruiz", "K. Shah", …

    A range: 7 cells in one column.

  3. SUMIFS(B2:B8,C2:C8,"<>")153.75

    SUMIFS: Adds values that meet every condition.

    • sum_rangeB2:B87 rows × 1 col: 38.50, 41.00, 36.00, 40.00, …
    • criteria_range1C2:C87 rows × 1 col: "M. Ruiz", (empty), "M. Ruiz", "K. Shah", …
    • criteria1"<>"

In Google Sheets

The same formula works in Google Sheets: =SUMIFS(B2:B8,C2:C8,"<>"). We ran it in Google Sheets mode on the same data and it returns 153.75.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=SUMIF(C2:C8,"<>",B2:B8)153.75SUMIF gives the same result; note the range to add comes last.
=SUMPRODUCT((C2:C8<>"")*B2:B8)153.75Also skips cells whose formula returns "", which "<>" counts as filled.

Common mistakes

  • A cell with a space, or a formula that returns "", looks empty but counts as not blank for "<>". Use the SUMPRODUCT version, or clean the column.
  • Putting the condition on the hours column (=SUMIF(B2:B8,"<>")) adds all the hours. Test the column that is blank or filled.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Sum if a cell is not blank

In F1, total the hours that have an approver in column C.

Questions

How do I sum if a cell is blank?

Use "" as the condition: =SUMIFS(B2:B8,C2:C8,"").

How do I add another condition, like a minimum?

Add a pair: =SUMIFS(B2:B8,C2:C8,"<>",B2:B8,">=40").

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.