Comparison Operators in Excel — With Examples (=, <>, >, <, >=, <=)
Learn Excel comparison operators: equal, not equal, greater than, less than, and between two numbers, in IF, COUNTIF and SUMIF.
Read Guide →You want the total sales for East and Paid — not East, not Paid, but the rows where both are true. SUMIF cannot do it: it takes one condition. SUMIFS can: =SUMIFS(C2:C11,B2:B11,"East",E2:E11,"Paid") — and it returns 4200, the three East-and-Paid orders in this guide. This page runs that formula and the rest on the same ten-order table, so you can check every answer yourself — one, two, three and four criteria, date ranges, wildcards, criteria in cells, and the either-or sum — plus the two traps: the sum range comes first, and every range must be the same size.
Quick takeaway: in SUMIFS the sum range comes first — SUMIF puts it last.
=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...) — up to 127 pairs.=SUMIFS(C2:C11,B2:B11,"East",E2:E11,"Paid") → 4200. Every condition must be TRUE.=SUMIF(B2:B11,"East",C2:C11) → 5100. Same answer, sum range last — that is the trap.">1000". A cell goes outside, joined with &: ">="&G2.
Every example below uses the same ten orders. Every result was checked against them.
| Excel row | A Rep | B Region | C Sales | D Order Date | E Status | F Notes |
|---|---|---|---|---|---|---|
| 2 | Alex | East | 1200 | 9/3/2026 | Paid | Rush |
| 3 | Priya | West | 850 | 9/15/2026 | Pending | (blank) |
| 4 | Jordan | east | 2400 | 10/2/2026 | Paid | Gift wrap |
| 5 | Sam | North | 450 | 10/9/2026 | Paid | Call first |
| 6 | Alex | West | 1750 | 10/20/2026 | Pending | (blank) |
| 7 | Taylor | East | 600 | 10/22/2026 | Paid | Rush |
| 8 | Priya | East | 900 | 11/4/2026 | Pending | (blank) |
| 9 | Jordan | South | 1100 | 11/12/2026 | Paid | Delivery |
| 10 | Sam | West | 300 | 11/20/2026 | Pending | (blank) |
| 11 | Alex | North | 1500 | 12/1/2026 | Paid | Rush |
=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
| Argument | Required | What it is |
|---|---|---|
| sum_range | Yes | The range of cells to sum — the numbers you actually want to add up |
| criteria_range1 | Yes | The first range Excel checks your condition against |
| criteria1 | Yes | The condition to check in that range |
| criteria_range2, criteria2, … | No | Extra range and condition pairs — up to 127 pairs in total, including the first |
The one thing to burn into memory: in SUMIFS the sum_range comes first. This trips up a lot of people, because in the older SUMIF function the range you add comes last. So if you already know SUMIF, SUMIFS flips the order on you. SUMIFS works in Excel for Microsoft 365, Excel 2024, 2021, 2019, 2016, and older versions back to 2007, plus Excel on the web.
Each new condition requires a separate range and criteria pair, and to be included in the final result, all conditions must be TRUE.
| What you want | Formula | Rows | Result |
|---|---|---|---|
| East | =SUMIFS(C2:C11,B2:B11,"East") | 2, 4, 7, 8 | 5100 |
| East AND Paid | =SUMIFS(C2:C11,B2:B11,"East",E2:E11,"Paid") | 2, 4, 7 | 4200 |
| West AND Pending | =SUMIFS(C2:C11,B2:B11,"West",E2:E11,"Pending") | 3, 6, 10 | 2900 |
| Sales > 1000 AND Paid | =SUMIFS(C2:C11,C2:C11,">1000",E2:E11,"Paid") | 2, 4, 9, 11 | 6200 |
| East AND Paid AND Sales > 1000 | =SUMIFS(C2:C11,B2:B11,"East",E2:E11,"Paid",C2:C11,">1000") | 2, 4 | 3600 |
| East AND Paid AND Sales > 1000 AND notes contain Rush | =SUMIFS(C2:C11,B2:B11,"East",E2:E11,"Paid",C2:C11,">1000",F2:F11,"*Rush*") | 2 | 1200 |
Read the rows. East alone is 5100 — four orders. Add Paid and it drops to 4200 — row 8 (East, Pending, 900) falls out. Add Sales over 1000 and it drops to 3600 — row 7 (East, Paid, 600) falls out. Add notes containing Rush and it drops to 1200 — row 4 (East, Paid, 2400, “Gift wrap”) falls out, because its note does not mention Rush. Every pair you add makes the condition stricter, since all of them must match. You can keep stacking pairs like this — up to 127 of them.
The same answer, two orders:
| Formula | Sum range position | Result |
|---|---|---|
=SUMIF(B2:B11,"East",C2:C11) | Third (last) | 5100 |
=SUMIFS(C2:C11,B2:B11,"East") | First | 5100 |
If you copy a SUMIF and add a second condition by changing the name to SUMIFS, the answer breaks — the sum range is in the wrong place. The fix is to move it to the front. The full SUMIF guide, with the mismatched-range trap, is on the SUMIF formula page.
A date range is two criteria on the same column — on or after the start, on or before the end:
| What you want | Formula | Rows | Result |
|---|---|---|---|
| October orders | =SUMIFS(C2:C11,D2:D11,">=10/1/2026",D2:D11,"<=10/31/2026") | 4, 5, 6, 7 | 5200 |
| November orders | =SUMIFS(C2:C11,D2:D11,">=11/1/2026",D2:D11,"<=11/30/2026") | 8, 9, 10 | 2300 |
| East orders in October | =SUMIFS(C2:C11,B2:B11,"East",D2:D11,">=10/1/2026",D2:D11,"<=10/31/2026") | 4, 7 | 3000 |
| East orders in November | =SUMIFS(C2:C11,B2:B11,"East",D2:D11,">=11/1/2026",D2:D11,"<=11/30/2026") | 8 | 900 |
| Q4 orders (Oct–Dec) | =SUMIFS(C2:C11,D2:D11,">=10/1/2026") | 4–11 | 9000 |
October is 5200 — 2400 + 450 + 1750 + 600. November is 2300 — 900 + 1100 + 300. East in October is 3000 — row 4 (2400, “east” in lowercase, which still counts) and row 7 (600). East in November is 900 — row 8 alone, because rows 9 and 10 are South and West. Write the date in the format your Excel expects, or use DATE: =SUMIFS(C2:C11,D2:D11,">="&DATE(2026,10,1),D2:D11,"<="&DATE(2026,10,31)). The month and year behind these dates are on the month and year from date page.
Wildcard characters such as ‘*’ and ‘?’ can be used within the criteria argument. Asterisk (*) matches any sequence of characters, and it can be used after, before or surrounding criteria to allow partial search criteria to be used. Question mark (?) matches any single character.
| What you want | Formula | Rows | Result |
|---|---|---|---|
| Notes contain Rush | =SUMIFS(C2:C11,F2:F11,"*Rush*") | 2, 7, 11 | 3300 |
| Rep starts with A | =SUMIFS(C2:C11,A2:A11,"A*") | 2, 6, 11 | 4450 |
| Notes are blank | =SUMIFS(C2:C11,F2:F11,"") | 3, 6, 8, 10 | 3800 |
| Notes are not blank | =SUMIFS(C2:C11,F2:F11,"<>") | 2, 4, 5, 7, 9, 11 | 7250 |
*Rush* means “anything, then Rush, then anything” — the same wildcard as the if cell contains text guide. A* means “starts with A” — Alex’s three orders, 1200 + 1750 + 1500. The blank test uses "" — an empty criteria — and the not-blank test uses "<>". To search for a literal ? or *, type a tilde ~ in front of it.
Put the condition in a cell and the formula updates when the cell changes:
| What you want | Formula (G2 holds the value) | Result |
|---|---|---|
| Region in G2 | =SUMIFS(C2:C11,B2:B11,G2) | 5100 when G2 is East |
| Sales at least G2 | =SUMIFS(C2:C11,C2:C11,">="&G2) | 6850 when G2 is 1200 |
| Sales over G2 | =SUMIFS(C2:C11,C2:C11,">"&G2) | 5650 when G2 is 1200 |
| Orders from G2 onwards | =SUMIFS(C2:C11,D2:D11,">="&G2) | 9000 when G2 is 1 Oct 2026 |
The operator goes inside quotes and the cell goes outside, joined with &: ">="&G2. Inside quotes, ">=1200" is text; outside, the cell is a value. The boundary matters here too: at least 1200 is 6850, over 1200 is 5650 — the difference is row 2’s 1200, as the comparison operators guide shows.
To be included in the final result, all conditions must be TRUE — SUMIFS has no OR. For either-or, add two SUMIFS together:
=SUMIFS(C2:C11,B2:B11,"East")+SUMIFS(C2:C11,B2:B11,"West")
That returns 8000 — East’s 5100 plus West’s 2900. The two ranges do not overlap (a row has one region), so nothing is counted twice. If the two conditions can overlap — say, East or Paid — add the overlap back out, or the shared rows count twice: East (5100) + Paid (7250) − East-and-Paid (4200) = 8150. Check it: the rows that are East or Paid are 2, 4, 5, 7, 8, 9, 11 — 1200 + 2400 + 450 + 600 + 900 + 1100 + 1500 = 8150.
| Mistake | What happens | Fix |
|---|---|---|
| You wrote the SUMIF order | =SUMIFS(B2:B11,"East",C2:C11) adds the regions, not the sales — or errors | Sum range first: =SUMIFS(C2:C11,B2:B11,"East") |
| Your ranges are different sizes | =SUMIFS(C2:C11,B2:B10,"East") returns #VALUE! — 10 rows against 9 | Keep every range the same number of rows |
| You wrote the operator without quotes | =SUMIFS(C2:C11,C2:C11,>1000) — Excel will not let you enter the formula | Quote it: ">1000" |
| You wrote the criteria as a number in quotes | =SUMIFS(C2:C11,C2:C11,"1200") matches only exactly 1200, not at least 1200 | Use the operator: ">=1200" |
| You expected OR | One SUMIFS with two pairs is AND — East and Paid, never East or Paid | Add two SUMIFS, and subtract the overlap if they can share rows |
| You used an array instead of a range | SUMIFS requires an actual range — Excel will not let you enter the formula | Use a range, or use SUMPRODUCT with a Boolean array |
| Your sum range holds TRUE/FALSE | TRUE evaluates to 1 and FALSE to 0, so the total is wrong | Sum numbers only — put the TRUE/FALSE test in a criteria range |
How do I use SUMIFS with multiple criteria? =SUMIFS(C2:C11,B2:B11,"East",E2:E11,"Paid") — the sum range first, then one range-and-criteria pair per condition. On the table above it returns 4200.
Is the sum range first or last in SUMIFS? First. In SUMIF it is last — that is the trap. =SUMIFS(C2:C11,B2:B11,"East") and =SUMIF(B2:B11,"East",C2:C11) both return 5100.
How many criteria can SUMIFS take? Up to 127 range/criteria pairs, including the first. Every one must be TRUE for the row to count.
How do I sum between two dates? Two criteria on the date column: =SUMIFS(C2:C11,D2:D11,">=10/1/2026",D2:D11,"<=10/31/2026") returns 5200 for October.
How do I sum only the rows that contain a word? =SUMIFS(C2:C11,F2:F11,"*Rush*") returns 3300 — the three Rush orders.
Why does my SUMIFS give #VALUE!? Your ranges are different sizes. =SUMIFS(C2:C11,B2:B10,"East") is 10 rows against 9 — keep every range the same number of rows.
Can SUMIFS do OR logic? No — it is AND-only. Add two SUMIFS together, and subtract the overlap if the two conditions can share rows.
That is the SUMIFS function in Excel: =SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...) — the sum range first, then one range-and-criteria pair per condition, up to 127 of them — and on the ten-order table in this guide it answers every question: East is 5100, East and Paid is 4200, East and Paid and over 1000 is 3600, and all four conditions together are 1200; October is 5200, November is 2300, East in October is 3000, and the Rush notes are 3300. Remember the two things that catch everyone once: in SUMIFS the sum range comes first, while in SUMIF it comes last — and every range must be the same size, or the formula returns #VALUE!. And remember the two rules that change the answer: operators go in quotes, with a cell joined by & — and SUMIFS is AND-only, so an either-or sum is two SUMIFS added together, with the overlap subtracted if the conditions can share rows. From here, the next functions worth learning are the ones this one sits next to — the SUMIF formula itself, for the single-criterion cases and the mismatched-range trap in full, and the COUNTIF formula for counting the same rows instead of adding them — and the full learning order for the whole site is on the Excel Formulas hub and the Logical & Conditional category page.
Learn Excel comparison operators: equal, not equal, greater than, less than, and between two numbers, in IF, COUNTIF and SUMIF.
Read Guide →Learn how to shade every other row in Excel: the MOD formula, banded table rows, odd rows, every third row and filters.
Read Guide →Learn the Excel formula for if a cell contains specific text: ISNUMBER with SEARCH, FIND for case, and COUNTIF wildcards.
Read Guide →