Spreadsheet Practice

How to calculate the net of credits and debits in Excel

Formula (Excel and Google Sheets)

=SUMIF(B2:B8,"Credit",C2:C8)-SUMIF(B2:B8,"Debit",C2:C8)

Subtract one SUMIF from the other: =SUMIF(B2:B8,"Credit",C2:C8)-SUMIF(B2:B8,"Debit",C2:C8).

Result on the example
$3,356.25 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 amounts are all positive and the Type column says which way the money went. One SUMIF adds the credits (7,505), the other adds the debits (4,148.75), and subtracting gives the net change for the period.

=SUMIF(B2:B8,"Credit",C2:C8)-SUMIF(B2:B8,"Debit",C2:C8)

Result3356.25

  1. B2:B87 rows × 1 col: "Credit", "Debit", "Debit", "Credit", …

    A range: 7 cells in one column.

  2. C2:C87 rows × 1 col: $5,200.00, $1,480.00, $312.50, $875.00, …

    A range: 7 cells in one column.

  3. SUMIF(B2:B8,"Credit",C2:C8)7505

    SUMIF: Adds values where the range meets a condition.

    • rangeB2:B87 rows × 1 col: "Credit", "Debit", "Debit", "Credit", …
    • criteria"Credit"
    • sum_rangeC2:C87 rows × 1 col: $5,200.00, $1,480.00, $312.50, $875.00, …
  4. SUMIF(B2:B8,"Debit",C2:C8)4148.75

    SUMIF: Adds values where the range meets a condition.

    • rangeB2:B87 rows × 1 col: "Credit", "Debit", "Debit", "Credit", …
    • criteria"Debit"
    • sum_rangeC2:C87 rows × 1 col: $5,200.00, $1,480.00, $312.50, $875.00, …
  5. SUMIF(B2:B8,"Credit",C2:C8)-SUMIF(B2:B8,"Debit",C2:C8)3356.25

    The - operator subtracts.

In Google Sheets

The same formula works in Google Sheets: =SUMIF(B2:B8,"Credit",C2:C8)-SUMIF(B2:B8,"Debit",C2:C8). We ran it in Google Sheets mode on the same data and it returns $3,356.25.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=SUMPRODUCT(((B2:B8="Credit")-(B2:B8="Debit"))*C2:C8)$3,356.25Gives each row a sign (+1 or -1) from its type and adds the signed amounts in one pass.

Common mistakes

  • =SUM(C2:C8) adds debits as if they were income. With unsigned amounts, the type column decides the sign.
  • A type typed differently ("debit ", "DR") falls out of both totals. Use a dropdown for the Type column.

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.

Calculate the net of credits and debits

In F1, calculate the net amount: total credits minus total debits.

Questions

How do I show a running balance?

Fill =SUMPRODUCT((($B$2:B2="Credit")-($B$2:B2="Debit"))*$C$2:C2) down a column.

How do I turn the amounts into signed numbers?

Use =IF(B2="Debit",-C2,C2); then a plain SUM gives the net.

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.