ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Comparisons
  3. VLOOKUP vs SUMIF: Which to Use for Totals

VLOOKUP vs SUMIF: Which to Use for Totals

By ExcelReady Team·Updated November 1, 2026·8 min read

The short answer

Use SUMIF for totals and VLOOKUP for looking up one value. VLOOKUP stops at the first matching row, so it gives the wrong total when a customer appears more than once. SUMIF adds every matching row. SUMIF can also look up a number by a unique ID, but it can't return text and returns 0, not #N/A, when nothing matches.

Key takeaways

  • VLOOKUP returns one value from the first matching row; SUMIF adds the numbers from every matching row.
  • For a total per customer, product or region, use SUMIF. VLOOKUP only sees the first row.
  • SUMIF can act as a lookup for numbers with unique IDs, and it can look to the left.
  • SUMIF returns 0 for text and for missing values, which can hide mistakes; VLOOKUP shows #N/A.
On this page+
  1. VLOOKUP vs SUMIF at a glance
  2. How the two functions work
  3. The same data, solved both ways
  4. When to use VLOOKUP
  5. When to use SUMIF
  6. Common mistakes with VLOOKUP and SUMIF
  7. Our recommendation
  8. Practise it

The short answer to VLOOKUP vs SUMIF: VLOOKUP finds one value from the first matching row, and SUMIF adds the numbers from every matching row. So for a total per customer, product or region, SUMIF is the right tool, and VLOOKUP gives a wrong answer whenever there's more than one match. This guide shows both on the same order list, including the cases where SUMIF can replace VLOOKUP and the traps when it does.

VLOOKUP vs SUMIF at a glance#

The two functions both search a column for a value, but they do different jobs with what they find.

FeatureVLOOKUPSUMIF
Main jobReturn one value from a matching rowAdd numbers from all matching rows
Syntax=VLOOKUP(lookup_value, table, col_num, FALSE)=SUMIF(range, criteria, sum_range)
Several matching rowsReturns the first one onlyAdds them all
Can return textYesNo (returns 0)
When nothing matches#N/A0
Can look to the leftNo: the key must be the first columnYes: sum range can be anywhere
Breaks if a column is insertedYes, if the column number becomes wrongNo
Comparisons like ">300"NoYes
Approximate match (bands, tiers)Yes, with TRUENo
Excel versionsAll versionsAll versions

How the two functions work#

VLOOKUP looks down the first column of a table for a value and returns the cell a set number of columns to the right:

Excel formula
=VLOOKUP(lookup_value, table_array, col_index_num, FALSE)

FALSE means exact match. Without it, VLOOKUP uses approximate match, which needs sorted data. The VLOOKUP function guide explains each argument.

SUMIF checks one column against a condition and adds the matching numbers from another column:

Excel formula
=SUMIF(range, criteria, [sum_range])

The important difference: VLOOKUP stops at the first match. SUMIF keeps going to the end of the range and adds every match. The SUMIF function guide covers the criteria you can use.

The same data, solved both ways#

Here is an order list. Some customers have several orders:

ABCD
1OrderCustomerProductAmount
21001AcmePaper120
31002BirchToner340
41003AcmeToner290
51004CobaltPaper80
61005BirchChairs950
71006AcmeDesk610
81007DeltaPaper150

Task 1: total spent by Acme#

Excel formula
=VLOOKUP("Acme",B2:D8,3,FALSE)
=SUMIF(B2:B8,"Acme",D2:D8)

VLOOKUP returns 120: the amount from row 2, Acme's first order. It never sees rows 4 and 7. SUMIF returns 1,020 (120 + 290 + 610), the correct total. No error warns you that VLOOKUP's answer is incomplete, which is what makes this mistake dangerous.

Task 2: the amount of order 1005#

Order numbers are unique, so there's only one match:

Excel formula
=VLOOKUP(1005,A2:D8,4,FALSE)
=SUMIF(A2:A8,1005,D2:D8)

Both return 950. With a unique key and a number to return, SUMIF works as a lookup.

Task 3: the product on order 1005#

Excel formula
=VLOOKUP(1005,A2:D8,3,FALSE)
=SUMIF(A2:A8,1005,C2:C8)

VLOOKUP returns Chairs. SUMIF returns 0, because it can only add numbers and the Product column holds text. For text, you need a lookup function.

Task 4: a customer who isn't in the list#

Excel formula
=VLOOKUP("Elm",B2:D8,3,FALSE)
=SUMIF(B2:B8,"Elm",D2:D8)

VLOOKUP shows #N/A: not found. SUMIF shows 0. In a sales summary, 0 is the right answer for a customer with no orders. In a lookup, a 0 can hide a typo such as "Acme " with a space.

Task 5: looking to the left#

To find which order belongs to a known amount, say 610, VLOOKUP can't help: the Order column is to the left of Amount. SUMIF doesn't care about column order:

Excel formula
=SUMIF(D2:D8,610,A2:A8)

This returns 1006. It works only because 610 appears once. For left lookups in general, INDEX and MATCH or XLOOKUP are safer; see VLOOKUP vs INDEX MATCH.

When to use VLOOKUP#

Use VLOOKUP (or its modern replacement, XLOOKUP) when you need one value about one item:

  • Returning text, such as a customer name, product description or status.
  • Pulling a price or rate from a list where each item appears once.
  • Band or tier lookups, such as tax bands or commission rates, using TRUE for approximate match. SUMIF can't do this.
  • When a missing value should shout. #N/A tells you the item isn't there, which is often what you want in a lookup.

If you have Excel 2021 or Microsoft 365, XLOOKUP is easier still: it looks left, defaults to exact match and doesn't use column numbers. The comparison of VLOOKUP vs XLOOKUP explains the switch. Practise VLOOKUP exact match to master the classic version first.

When to use SUMIF#

Use SUMIF when you need a total, or when 0 is a sensible answer for "nothing found":

  • Totals per group: per customer, product, region, month or category.
  • Summary tables where some groups may have no rows yet. 0 looks cleaner than #N/A.
  • Numeric lookups with unique keys in a sheet that already uses SUMIF, especially when the value you want is to the left of the key.
  • Conditions beyond equal to, like ">300" or "Ac*", which VLOOKUP can't use.

A typical summary table lists each customer once and fills one SUMIF down. With the customer names in F2:F5, type this in G2 and fill down:

Excel formula
=SUMIF($B$2:$B$8,F2,$D$2:$D$8)

Acme shows 1,020, Birch 1,290, Cobalt 80 and Delta 150. A quick check is that these add up to =SUM(D2:D8), which is 2,540. If they don't, a name in the list is spelled differently from the data. The $ signs keep the ranges fixed while F2 moves down to F3, F4 and F5.

For two or more conditions, such as Acme and Toner, switch to SUMIFS. The comparison of SUMIF vs SUMIFS shows how. Practise SUMIF to build totals like these in a live sheet.

Common mistakes with VLOOKUP and SUMIF#

These are the slips that most often give wrong results:

  1. Using VLOOKUP for a total. It returns the first match only. If a value can appear more than once, use SUMIF.
  2. Using SUMIF as a lookup on duplicate keys. If order 1004 is accidentally entered twice, SUMIF adds both rows and returns double the amount, with no warning. Check uniqueness with =COUNTIF(A2:A8,1004).
  3. Expecting SUMIF to return text. It returns 0. Use VLOOKUP or XLOOKUP.
  4. Forgetting FALSE in VLOOKUP. Without it, VLOOKUP uses approximate match and can return a value from the wrong row in unsorted data.
  5. Trusting a 0 from SUMIF. A 0 may mean "no orders" or "the name is misspelled". Spot-check with COUNTIF.
  6. Hard-coded column numbers. Inserting a column inside a VLOOKUP table shifts the column you meant. SUMIF points at the column directly, so it's not affected. The comparison of VLOOKUP vs HLOOKUP shows the same column-number issue in the horizontal version.

This exact choice comes up in Excel tests: a question asks for a customer's total, and VLOOKUP is the tempting wrong answer. The article on Excel test questions and answers has more examples, and the intermediate Excel test lets you practise under time pressure.

Our recommendation#

Match the function to the question. If the answer is a total that could come from several rows, use SUMIF. If the answer is one value about one item, especially text, use VLOOKUP, or XLOOKUP if everyone has Excel 2021 or Microsoft 365. Use SUMIF as a lookup only for numbers with keys you know are unique.

In short: SUMIF for totals, VLOOKUP for single values.

Practise it#

Try the exercise on this page: VLOOKUP would return only Acme's first order, so SUMIF is the right choice. Then practise SUMIF in a live spreadsheet and practise VLOOKUP exact match to see the difference on real data.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Acme has placed several orders. In G2, use SUMIF to total all of Acme's order amounts (D2:D8), checking the Customer column (B2:B8). VLOOKUP would only return the first order.

fx
ABCDEFGH
1
Order
Customer
Product
Amount
2
1001
Acme
Paper
120
Acme total
3
1002
Birch
Toner
340
4
1003
Acme
Toner
290
5
1004
Cobalt
Paper
80
6
1005
Birch
Chairs
950
7
1006
Acme
Desk
610
8
1007
Delta
Paper
150
9
10
11

Tip: SUMIF goes: the column to check (B2:B8), what to match ("Acme"), then the column to add (D2:D8).

Practise this in a lesson

LessonVLOOKUP exact matchPull product names and prices from a catalog with VLOOKUP, and lock the table so the formula fills down cleanly.LessonSUMIFAdd up only the numbers that meet a condition, with and without a separate sum range.Function guideVLOOKUPLearn VLOOKUP with clear examples, the 4 most common mistakes, and a live practice exercise you can try in your browser.Function guideSUMIFAdd up values that meet one condition with SUMIF. Totals by category, person or amount, the argument-order trap, and a live exercise.

Frequently asked questions

Can I use SUMIF instead of VLOOKUP?

+

Only to look up numbers by a unique ID. In that case SUMIF returns the same value as VLOOKUP and can even look to the left. It can't return text, and it quietly adds duplicates, so VLOOKUP or XLOOKUP is safer for general lookups.

Why does VLOOKUP give the wrong total?

+

VLOOKUP stops at the first row that matches, so it returns one amount rather than adding all of them. If a customer has three orders, it returns only the first. Use SUMIF to add every matching row.

Why does SUMIF return 0 instead of #N/A?

+

When no row matches, there is nothing to add, so SUMIF returns 0. That's useful in totals but can hide a typo in a lookup value. Check with COUNTIF that the value exists if a 0 looks suspicious.

Can SUMIF return text?

+

No. SUMIF adds numbers, so if the matching cell holds text it returns 0. To return a name, product or status, use VLOOKUP, XLOOKUP or INDEX and MATCH.

Sources

  • VLOOKUP function - Microsoft Support
  • SUMIF function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. VLOOKUP vs SUMIF at a glance
  2. How the two functions work
  3. The same data, solved both ways
  4. When to use VLOOKUP
  5. When to use SUMIF
  6. Common mistakes with VLOOKUP and SUMIF
  7. Our recommendation
  8. Practise it

Keep reading

Comparisons· 8 min read

SUMIF vs SUMIFS: What's the Difference?

SUMIF adds up numbers that meet one condition. SUMIFS adds up numbers that meet one or more conditions, and every condition must be true. The other big difference is argument order: SUMIF puts the range to add last, while SUMIFS puts it first. Both work in every current version of Excel.

Comparisons· 7 min read

VLOOKUP vs HLOOKUP: What's the Difference?

VLOOKUP searches down the first column of a table and returns a value from a column to the right. HLOOKUP searches across the top row and returns a value from a row below. Use VLOOKUP when your records run down the sheet, which is most tables, and HLOOKUP only when the labels run across the top.

Comparisons· 7 min read

VLOOKUP vs INDEX MATCH: Differences and When to Use Each

Use VLOOKUP for quick lookups to the right in a table that won't change shape. Use INDEX MATCH when you need to look left, when columns may be inserted, or when you want a two-way lookup. Both work in every version of Excel, so INDEX MATCH is the flexible choice when XLOOKUP isn't available.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free