Google Sheets SUMIF Based on Another Column: How-To

How-to basics · Updated November 23, 2026

To sum values in one column based on criteria in another column, use the SUMIF function with the range set to the criteria column and the sum_range set to the values column, like this: =SUMIF(A2:A100, "Paid", B2:B100) which sums all amounts in B where column A says “Paid”. This is the direct answer; the rest of this article explains how it works, common mistakes, and advanced variations.

How SUMIF Works in Google Sheets

SUMIF is a conditional summing function. It evaluates a range of cells (the range) against a condition (the criterion) and then adds up the corresponding cells in a second range (the sum_range). The key to using it based on another column is understanding that the range and sum_range do not have to be the same column—they just need to be the same size and aligned row by row.

The syntax is: =SUMIF(range, criterion, [sum_range])

  • range: the cells to test against the criterion (e.g., the category column).
  • criterion: the condition, written as text, number, or expression (e.g., “Completed”, “>100”, or a cell reference like D1).
  • sum_range: the cells to add up if the corresponding range cell matches. If omitted, SUMIF sums the range itself.

For example, with product names in A2:A20 and sales amounts in B2:B20, to sum sales for the product “Widget”, use =SUMIF(A2:A20, "Widget", B2:B20). The function checks each cell in A2:A20; wherever it finds “Widget”, it adds the matching cell from B2:B20.

Real-World Example: Sales by Region

Imagine a spreadsheet where column A lists regions (North, South, East, West) and column B lists order totals. To get the total for the South region:

  1. Click an empty cell, say D1.
  2. Type =SUMIF(A2:A100, "South", B2:B100).
  3. Press Enter. The result is the sum of all B values where the corresponding A cell equals “South”.

If you have a cell containing the region name (e.g., E1 has “South”), you can reference it instead of typing text: =SUMIF(A2:A100, E1, B2:B100). This makes the formula dynamic—change E1 to “North” and the sum updates automatically.

For partial matches, use wildcards. The asterisk (*) matches any sequence of characters, and the question mark (?) matches a single character. To sum all amounts where the region starts with “N”, use =SUMIF(A2:A100, "N*", B2:B100).

Using SUMIF with Numbers and Dates

SUMIF also works with numeric criteria. To sum all sales over $500: =SUMIF(B2:B100, ">500", B2:B100). Note here the range and sum_range are the same column—that’s fine. To sum sales in column B where column A (a date) is after January 1, 2024, use =SUMIF(A2:A100, ">"&DATE(2024,1,1), B2:B100). The ampersand (&) concatenates the comparison operator with the date value. For dates, you must use the DATE function or a cell reference containing a date; typing “1/1/2024” as text won’t work reliably.

For blank or non-blank cells, use "" or "<>". To sum amounts where column A is empty: =SUMIF(A2:A100, "", B2:B100). To sum where column A is not empty: =SUMIF(A2:A100, "<>", B2:B100).

Common Mistakes and How to Fix Them

Three frequent errors trip up users:

  • Mismatched ranges: If range and sum_range are different sizes, SUMIF returns an error or incorrect results. Always make them the same number of rows (e.g., A2:A100 and B2:B100).
  • Text vs. numbers: If your criteria column contains numbers stored as text (often left-aligned), a numeric criterion won’t match. Use =SUMIF(A2:A100, "123", B2:B100) instead of =SUMIF(A2:A100, 123, B2:B100), or convert the column to numbers using Data > Split text to columns or the VALUE function.
  • Case sensitivity: SUMIF is case-insensitive, so “south” and “South” both match. If you need case-sensitive matching, use SUMPRODUCT with EXACT, e.g., =SUMPRODUCT(--(EXACT(A2:A100,"South")), B2:B100).

Another common misconception is that SUMIF can use a criterion from a different row. It cannot—it only works row by row. For more complex logic across multiple conditions, use SUMIFS.

SUMIFS: Multiple Criteria from Different Columns

When you need to sum based on conditions in two or more columns, use SUMIFS. The syntax is =SUMIFS(sum_range, criteria_range1, criterion1, [criteria_range2, criterion2, ...]). Note that sum_range comes first, unlike SUMIF.

Example: Sum sales in column C where column A is “South” and column B is “Widget”. With data in A2:C100, use =SUMIFS(C2:C100, A2:A100, "South", B2:B100, "Widget"). You can add up to 30 range/criterion pairs. This is the go-to function when your condition spans multiple columns, which is a common follow-up to a single-column SUMIF question.

Alternatives: QUERY and FILTER

For advanced users, the QUERY function can sum with conditions using SQL-like syntax. To sum column B where column A equals “South”: =QUERY(A2:B100, "select sum(B) where A = 'South' label sum(B) ''"). This returns a single number. QUERY is powerful but has a learning curve and requires careful quoting of text criteria.

FILTER is another alternative. To get the sum of B where A is “South”, use =SUM(FILTER(B2:B100, A2:A100="South")). FILTER returns an array of matching B values, and SUM adds them. This is more flexible for complex conditions but can be slower on very large datasets.

Frequently Asked Questions

Can SUMIF reference a whole column like A:A? Yes, you can use =SUMIF(A:A, "South", B:B). This works and is convenient, but it may slow down your sheet because it processes all 1,048,576 rows. For most sheets, limiting to a specific range like A2:A1000 is better for performance.

Why is my SUMIF returning 0 when I know there are matches? Check for extra spaces in your data (e.g., “South ” vs “South”). Use TRIM to clean data, or use wildcards: =SUMIF(A:A, "*South*", B:B). Also verify that the sum_range contains numbers, not text-formatted numbers.

Does SUMIF work with dates in another column? Yes, but you must use a date value, not a text string. Use =SUMIF(A:A, ">"&DATE(2024,1,1), B:B) or reference a cell containing a date. If your dates are text, convert them with DATEVALUE first.

How do I sum based on a cell containing a criterion? Use the cell reference directly as the criterion: =SUMIF(A:A, D1, B:B). If D1 contains “South”, it sums all South values. This is the most flexible way to make your formula interactive.

Is SUMIF case-sensitive? No, SUMIF and SUMIFS ignore case. If you need case-sensitive sums, use SUMPRODUCT with EXACT as shown earlier, or use a helper column with EXACT to create a TRUE/FALSE flag.

Can I use SUMIF with a criteria range that is not adjacent to the sum range? Yes, the two ranges can be anywhere in the sheet as long as they have the same number of rows. For example, =SUMIF(Sheet2!A2:A100, "Paid", Sheet1!B2:B100) works if both ranges are 99 rows tall.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.