Highlight Row in Excel — With Examples (Conditional Formatting by Cell Value)
Learn how to highlight an entire row in Excel based on a cell value: the locked-column formula, text, numbers, dates and mistakes.
Read Guide →You have a list of ten orders worth $11,050 in total, and you need one number: how much came from the East, how much is already Paid, how much was sold for over $1,000. That is what SUMIF does — it adds up only the numbers that pass one test you give it. The formula has three parts, =SUMIF(range, criteria, [sum_range]), and the only thing that trips people up is the third one: when the test and the numbers live in different columns you need it, and when the test is on the numbers themselves you can leave it out. This guide gives you that rule first, then runs every example on one ten-row sales table — the same table as the COUNTIF article, so the two articles agree with each other — text, numbers, dates, wildcards, a cell reference, and SUMIFS for two conditions.
Quick takeaway: three parts — the test range, the test, and the numbers to add.
=SUMIF(range, criteria, [sum_range]) — add the numbers that pass one test.sum_range out."East", ">1000". Plain numbers and cell references do not: 1200, G2."East" matches east and EAST.SUMIFS.
=SUMIF(range, criteria, [sum_range])
| Part | What it does |
|---|---|
range | The cells checked against the criterion — the column the test is applied to |
criteria | The test a cell must pass — a number, text, a comparison, a cell reference, or a wildcard pattern |
[sum_range] | Optional. The actual cells to add. If it is left out, the cells in range are summed instead |
The rule for the third part, in one sentence: when the test and the numbers live in different columns, give all three parts; when the test is on the numbers themselves, leave sum_range out and SUMIF adds the range itself.
Every formula below uses this ten-row sales list — the same table as the COUNTIF formula article, so the counts and the sums agree with each other. Total sales: $11,050.
| 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 | |
| 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 | |
| 7 | Taylor | East | 600 | 10/22/2026 | Paid | Rush |
| 8 | Priya | East | 900 | 11/4/2026 | Pending | |
| 9 | Jordan | South | 1100 | 11/12/2026 | Paid | Delivery |
| 10 | Sam | West | 300 | 11/20/2026 | Pending | |
| 11 | Alex | North | 1500 | 12/1/2026 | Paid | Rush |
Row 1 holds the headings. Note the trap built into the table on purpose: row 4 has “east” in lowercase — it counts and sums exactly like “East”.
The most common use. The test is on the Region column, the numbers are in the Sales column, so all three parts are needed.
| Goal | Formula | Result |
|---|---|---|
| Total sales from the East | =SUMIF(B2:B11, "East", C2:C11) | $5,100 |
| Total sales from the West | =SUMIF(B2:B11, "West", C2:C11) | $2,900 |
| Total sales from the North | =SUMIF(B2:B11, "North", C2:C11) | $1,950 |
| Total sales from the South | =SUMIF(B2:B11, "South", C2:C11) | $1,100 |
| Total sales by Alex | =SUMIF(A2:A11, "Alex", C2:C11) | $4,450 |
| Total sales of Paid orders | =SUMIF(E2:E11, "Paid", C2:C11) | $7,250 |
Check the work: East $5,100 + West $2,900 + North $1,950 + South $1,100 = $11,050, the whole table. And Paid $7,250 + Pending $3,800 = $11,050 too. If your four region totals do not add up to the grand total, a row was missed — usually a lowercase twin or a trailing space. East is $5,100 because the lowercase “east” in row 4 ($2,400) is included: 1,200 + 2,400 + 600 + 900 = 5,100.
When the test is on the numbers themselves, there is no third part — SUMIF adds the range it tested.
| Goal | Formula | Result |
|---|---|---|
| Sales over $1,000 | =SUMIF(C2:C11, ">1000") | $7,950 |
| Sales of $1,000 or more | =SUMIF(C2:C11, ">=1000") | $7,950 |
| Sales under $500 | =SUMIF(C2:C11, "<500") | $750 |
| Sales exactly $1,200 | =SUMIF(C2:C11, 1200) | $1,200 |
Two things to notice. First, ">1000" and ">=1000" give the same answer here — $7,950 — because no sale is exactly $1,000. A sale of exactly $1,000 would be added by ">=1000" and missed by ">1000". Second, the quotes are compulsory around the operator and the number together — >1000 without quotes is not a valid formula — but a plain number needs no quotes: =SUMIF(C2:C11, 1200) works.
Dates are criteria in quotes, just like text. Excel compares the date in the cell with the date in the quotes, and adds the matching rows’ sales.
| Goal | Formula | Result |
|---|---|---|
| Sales from orders after 1 Oct 2026 | =SUMIF(D2:D11, ">10/1/2026", C2:C11) | $9,000 |
| Sales from orders before 1 Oct 2026 | =SUMIF(D2:D11, "<10/1/2026", C2:C11) | $2,050 |
The two answers add up to $11,050, the whole table — a good check that nothing was missed. One warning: the date in the quotes must be one Excel recognises as a date. If your dates are written day-first (3/9/2026 for 3 September), write the criteria the same way your Excel expects, or put the cutoff date in a cell and point at it instead — the cell-reference section below shows how.
When you want rows that contain a word, not just equal it, use wildcards. The asterisk (*) stands for any number of characters, including none. The question mark (?) stands for exactly one character.
| Goal | Formula | Result |
|---|---|---|
| Total sales by reps whose name starts with A | =SUMIF(A2:A11, "A*", C2:C11) | $4,450 |
| Total sales of Rush orders | =SUMIF(F2:F11, "*Rush*", C2:C11) | $3,300 |
“Names starting with A” gives $4,450 — the three Alex rows. “Rush” with an asterisk on both sides adds any row containing the word Rush anywhere — $1,200 + $600 + $1,500 = $3,300. This is the answer to “sum if a cell contains specific text”: wrap the word in asterisks, and put the numbers column as the sum_range. If you need to count the matching rows instead of adding them, the count cells with text guide runs the same wildcard idea on its own ten-row table.
Hard-coding “East” in the formula is fine once. When the value changes, put it in a cell and point at it — no quotes around the cell reference.
Say cell H2 holds the word East:
=SUMIF(B2:B11, H2, C2:C11)
That gives $5,100, the same as "East". For a comparison against a cell, join the operator to the cell with &: say H3 holds 1000:
=SUMIF(C2:C11, ">"&H3)
That gives $7,950, the sales over $1,000. Change H3 to 1500 and the sum updates without touching the formula. The quotes stay only around the operator — the cell reference itself is never quoted.
SUMIF applies only one condition. When two things must be true at once, use SUMIFS — same idea, but every condition gets its own range and criteria, in pairs, and the sum_range comes first.
| Goal | Formula | Result |
|---|---|---|
| East sales that are Paid | =SUMIFS(C2:C11, B2:B11, "East", E2:E11, "Paid") | $4,200 |
| West sales that are Pending | =SUMIFS(C2:C11, B2:B11, "West", E2:E11, "Pending") | $2,900 |
| Sales over $1,000 that are Paid | =SUMIFS(C2:C11, C2:C11, ">1000", E2:E11, "Paid") | $6,200 |
East and Paid gives $4,200: of the four East rows, three are Paid (1,200 + 2,400 + 600) and one (Priya, row 8, $900) is Pending. Notice the argument order flips: SUMIFS puts the sum_range first, then the range-criteria pairs. Mixing the two orders up is the most common SUMIFS mistake. SUMIFS gets its own full guide later in this series — this section is only the introduction.
This is the trap no competitor shows with numbers, and it is worse than an error, because Excel does not warn you. Microsoft’s rule: sum_range should be the same size and shape as range. If it is not, Excel sums a range that starts with the first cell in sum_range but has the same dimensions as range.
Watch what happens with the North region, whose two rows are row 5 ($450) and row 11 ($1,500):
| Formula | What Excel actually adds | Result |
|---|---|---|
=SUMIF(B2:B11, "North", C2:C11) | C2:C11, the full sales column | $1,950 |
=SUMIF(B2:B11, "North", C2:C5) | C2:C11 anyway — the range is 10 rows, so Excel takes 10 rows from C2 | $1,950 |
=SUMIF(B2:B5, "North", C2:C11) | Only C2:C5 — the range is 4 rows, so Excel takes 4 rows from C2 | $450 |
The third formula is the dangerous one: it returns $450, not an error, and the $1,500 in row 11 is silently missed — because row 11 is outside the four rows Excel took. The fix is simple: always make sum_range the same size and shape as range.
Three functions that all add, and the difference is how many conditions they take.
| Function | Adds | Example on this table |
|---|---|---|
| SUM | Everything in the range | =SUM(C2:C11) → $11,050 |
| SUMIF | Values passing one condition | =SUMIF(B2:B11, "East", C2:C11) → $5,100 |
| SUMIFS | Values passing two or more conditions | =SUMIFS(C2:C11, B2:B11, "East", E2:E11, "Paid") → $4,200 |
If your sum is too high, you probably used SUM where you meant SUMIF. If it is too low, check the mismatched sum_range trap above before anything else.
The most common failure, and it is almost never the function. Work through these in order.
| Check | What happens | Fix |
|---|---|---|
| No match at all | Nothing in the range passes the test — e.g. “Central” is not in the table — so the sum is 0, correctly | That 0 is the right answer; check the spelling of the criteria |
| A trailing space | The cell holds “East ” with a space, and SUMIF does not trim spaces — "East" does not match "East " | Remove the space, or use =SUMIF(B2:B11, "East*", C2:C11) |
| Numbers stored as text | The sales column shows 1200 but holds text, so SUMIF adds nothing | Convert the column to numbers first (Paste Special → Multiply by 1) |
| sum_range the wrong size | The range is 4 rows but the match is in row 11, so it is silently missed | Make sum_range the same size and shape as range |
| Mistake | What happens | Fix |
|---|---|---|
| You left sum_range out when the test is on text | SUMIF adds the text column, which is 0 — text adds to nothing | Give all three parts: =SUMIF(B2:B11, "East", C2:C11) |
You wrote >1000 without quotes | Excel will not accept the formula | Put the operator and number in quotes: ">1000" |
| You quoted a cell reference | =SUMIF(B2:B11, "H2", C2:C11) looks for the text “H2” | Drop the quotes: =SUMIF(B2:B11, H2, C2:C11) |
| You used SUMIF’s order in SUMIFS | SUMIFS puts sum_range first — the wrong order sums the wrong column | SUMIFS: =SUMIFS(sum_range, range1, criteria1, ...) |
| You expected case to matter | “East” and “east” added together, and your sum looks too high | That is correct behaviour — check for a lowercase twin |
What is the SUMIF formula in Excel? =SUMIF(range, criteria, [sum_range]). For example, =SUMIF(B2:B11, "East", C2:C11) adds the sales of the East orders. The result is a single number.
How do I sum if a cell contains specific text in Excel? Wrap the word in asterisks: =SUMIF(F2:F11, "*Rush*", C2:C11) adds the sales of every row whose Notes contain Rush — $3,300 on this table.
What is the difference between SUMIF and SUMIFS? SUMIF applies one condition. SUMIFS applies two or more, each with its own range and criteria — and SUMIFS puts the sum_range first, while SUMIF puts it last. SUMIFS gets its own full guide later in this series.
Why does my SUMIF return 0? Usually no match at all (and 0 is then correct), a trailing space in the data, numbers stored as text, or a sum_range the wrong size. The “why it returns 0” table above gives them in order.
Do I always need the sum_range? No. When the test is on the numbers themselves — =SUMIF(C2:C11, ">1000") — leave it out and SUMIF adds the range itself. When the test is on text in another column, you need all three parts.
Is SUMIF case-sensitive? No. “East”, “east” and “EAST” all count as the same value. If your sum looks too high, a lowercase twin is the usual cause.
Does SUMIF work with dates? Yes — dates go in quotes like text: =SUMIF(D2:D11, ">10/1/2026", C2:C11) adds the sales of orders after 1 October 2026 — $9,000 on this table.
That is the SUMIF formula in Excel: three parts, the test range, the test, and the numbers to add — with the third part needed only when the test and the numbers live in different columns. On the ten-row table in this guide, that one rule answers every question: $5,100 from the East (including the lowercase “east”), $7,950 in sales over $1,000, $9,000 from orders after 1 October, $3,300 from Rush orders, and $4,200 from East orders that are Paid. When one condition is not enough, SUMIFS takes the same pattern and adds a second range and criteria — but remember it puts the sum_range first. And when the answer comes back 0 or too low, do not blame the function: check for a trailing space, numbers stored as text, or a sum_range that does not match the range in size. From here, the next functions worth learning are the ones this one sits next to — the COUNTIF formula for counting instead of adding, and the full learning order for the whole site is on the Excel Formulas hub and the Logical & Conditional category page.
Learn how to highlight an entire row in Excel based on a cell value: the locked-column formula, text, numbers, dates and mistakes.
Read Guide →Learn the IF formula in Excel: one condition, nested IF, IF with AND and OR, and IFS — with worked examples on...
Read Guide →Learn the COUNTIF formula in Excel: count cells by text, number, date or wildcard, with worked examples — plus COUNTIFS for two...
Read Guide →