How to total sales per customer with SUMIF

· 6 min read

Once orders are in a sheet, the next question is who buys the most. SUMIF answers it for every customer at once: it reads the whole order list and adds up only the rows that belong to one name.

This guide uses the order sheet from how to track customer orders in Google Sheets: an Orders tab with Order date in column B, Customer in C, Status in G and Amount in J, plus a Customers tab with one customer per row from A2 down. If your columns differ, change the letters.

Put one SUMIF beside each customer

On the Customers tab, pick the first free column. In the layout above that is D. Type Total sales in D1 and put this in D2:

=SUMIF(Orders!C:C, A2, Orders!J:J)

Fill it down to the last customer. Google's SUMIF page gives the syntax as SUMIF(range, criterion, [sum_range]), and the three parts here are:

  1. Orders!C:C is where to look: the Customer column.
  2. A2 is what to look for: the name on this row of the Customers tab.
  3. Orders!J:J is what to add: the Amount on every row where the name matched.

Check it against eight orders

Here is the Orders tab with some columns left out to fit:

Order ID Order date Customer Status Amount
ORD-1001 2026-11-05 Cafe Lotus Delivered 1,350
ORD-1002 2026-11-10 Hill Stores Delivered 720
ORD-1003 2026-11-12 Corner Bakery Cancelled 420
ORD-1004 2026-11-15 Cafe Lotus Shipped 1,120
ORD-1005 2026-11-18 Hill Stores Packed 540
ORD-1006 2026-11-24 Corner Bakery New 300
ORD-1007 2026-11-26 Cafe Lotus New 450
ORD-1008 2026-11-27 Hill Stores New 600

And the Customers tab after filling the formula down:

Customer Total sales How it adds up
Cafe Lotus 2,920 1,350 + 1,120 + 450
Hill Stores 1,860 720 + 540 + 600
Corner Bakery 720 420 + 300

Prove that no order was missed

SUMIF never shows an error when a name does not match. It leaves that row out and gives you a smaller number. So add one check under the list. Below the last customer:

=SUM(D2:D4)

and beside it:

=SUM(Orders!J2:J)

The first adds the customer totals: 2,920 + 1,860 + 720 = 5,500. The second adds every order: also 5,500. When the two agree, every order has landed on a customer.

Now suppose ORD-1007 had been typed as "Lotus Cafe". Cafe Lotus drops to 2,470, the customer totals add up to 5,050, and the orders still add up to 5,500. The 450 gap is the missing order. To find which row it is, use a free column on the Orders tab, such as M, and put this in M2:

=IF(OR(C2="", COUNTIF(Customers!$A$2:$A, C2)>0), "", "Check name")

Fill it down. It stays blank when the customer is on the Customers tab and shows Check name when it is not. Retype the flagged names. A stray space after a name is a common cause and cannot be seen on screen. Google's TRIM page describes a function that removes leading, trailing and repeated spaces, which helps when you are cleaning many names at once.

The lasting fix is to stop names being typed at all. A dropdown that reads the Customers tab does that, and the steps are the same as in how to use a dropdown for order status.

Leave out cancelled orders

Corner Bakery's 720 includes a cancelled order for 420. That is not a sale. SUMIF cannot fix this by itself: Google's page says it can only perform conditional sums with a single criterion. SUMIFS takes several. Change D2 to:

=SUMIFS(Orders!J:J, Orders!C:C, A2, Orders!G:G, "<>Cancelled")

Notice the order has flipped. Google's SUMIFS page puts the column to add first, then each column to look in followed by what to look for. "<>Cancelled" means "is not Cancelled".

Customer Total sales
Cafe Lotus 2,920
Hill Stores 1,860
Corner Bakery 300

The three now add up to 5,080, which is 5,500 less the cancelled 420. For the check, compare with =SUMIFS(Orders!J:J, Orders!G:G, "<>Cancelled"), which also gives 5,080. Our guide to SUMIFS for stock in and stock out traces the function row by row.

Total sales for a period

A lifetime total favours your oldest customers. To see who is buying now, add a date condition. For orders placed on or after 15 November:

=SUMIFS(Orders!J:J, Orders!C:C, A2, Orders!G:G, "<>Cancelled", Orders!B:B, ">="&DATE(2026,11,15))

The & joins the comparison to the date, so the last condition reads "Order date is on or after 15 November 2026".

Customer Sales since 15 November
Cafe Lotus 1,570
Hill Stores 1,140
Corner Bakery 300

Cafe Lotus is 1,120 + 450 and Hill Stores is 540 + 600. The two delivered orders from early November are left out. Put this in its own column, such as E, so you keep the lifetime figure beside it.

Rank your customers

The Customers tab stays in the order you typed it. For a ranked list, add a tab called Top customers, copy the four headers from the Customers tab into row 1, and put this in A2:

=SORT(Customers!A2:D4, 4, FALSE)

The 4 tells SORT to order by the fourth column of the range, which is Total sales, and Google's SORT page says FALSE sorts in descending order. With the totals that leave out cancelled orders, the rows come out as Cafe Lotus 2,920, Hill Stores 1,860, Corner Bakery 300. Change D4 to your last customer row. The list re-sorts by itself when a total changes.

Or let a pivot table do the adding

If you only want a quick look and no formula to maintain, a pivot table gives the same totals. Google's page on pivot tables lists the steps:

  1. Select the order data, headers included. Each column needs a header.
  2. Click Insert, then Pivot table.
  3. In the side panel, next to Rows, click Add and choose Customer.
  4. Next to Values, click Add and choose Amount. Summarize by should read SUM.

It shows 2,920, 1,860 and 720, the same as the first SUMIF, cancelled order included. The same page says a pivot table refreshes any time you change the source cells it is drawn from.

Fix a total that looks wrong

  • A customer shows 0. The name on the Customers tab does not match any order. Run the Check name column above.
  • The total is too low. One of the amounts may be text, not a number. Type =ISNUMBER(J2) in an empty cell and fill it down. Text gives FALSE.
  • You typed the name into the formula and got an error. Google's page says a text criterion must be in quotation marks, as in =SUMIF(Orders!C:C, "Hill Stores", Orders!J:J).
  • One name picks up another customer's orders. The same page says * in a criterion matches any run of characters and ? matches any single one. "Hill*" would add Hill Stores and Hillside Cafe together.

Sales and money received are different numbers. For what each customer still owes, see how to see which orders are unpaid in a spreadsheet.

Where BoltSheets fits

Everything above works in a plain Google Sheet. The BoltSheets order tracker template has a Customers tab with an Orders count and a Total spent column, and Total spent uses the SUMIFS from this guide that leaves out cancelled orders. It does not have the period total, the Check name column or the ranked tab, so those are yours to add. In the demo you can ask "who is our top customer by spend?" in words. Total spent is a formula cell, and BoltSheets never writes to formula cells. A change such as adding an order is shown as a preview and written only when a person confirms it. BoltSheets is in early access and works with Google Sheets only.

Common questions

Should I use SUMIF or SUMIFS?

Either works for one condition. =SUMIFS(Orders!J:J, Orders!C:C, A2) returns the same figure as the SUMIF in this guide. The column to add comes first in SUMIFS and last in SUMIF, so if you expect to add a second condition later, starting with SUMIFS saves rewriting the formula.

How do I count orders per customer instead of adding them up?

Use COUNTIF on the same column, =COUNTIF(Orders!C:C, A2). In the example it gives 3 for Cafe Lotus. If one order can take several rows, this counts rows, not orders.

What if I do not have a Customers tab?

Make the list with a formula. In A2 of a new tab, =UNIQUE(FILTER(Orders!C2:C, Orders!C2:C<>"")) lists each customer name once, and the SUMIF goes beside it. If a customer shows up twice in that list, the name has been typed two different ways on the Orders tab.

How do I total only the orders that have been paid?

Add a condition on the payment column. With Payment status in column I, =SUMIFS(Orders!J:J, Orders!C:C, A2, Orders!I:I, "Paid") adds the amounts for that customer's paid orders only.