Explainer

Criteria

A criterion is the condition a cell must meet to be counted, added up or averaged: how to write exact, comparison, date and blank criteria, and how to combine several.

Last updated: 14 October 2026

Explains: criteria

What it is: A criterion is the condition COUNTIF, SUMIF and their relatives test every cell against: a value such as Bakker, a comparison such as >10000 or a text pattern. A cell that passes is counted or added up, one that fails is skipped.

Why it matters: Almost every audit count or total on a journal starts with one, for example invoices above a threshold, entries in a period or manual entries without approval. A criterion looks like a plain value but follows rules that go wrong without an error message: where the quotes go, how a date is joined, which cells count as blank. This page sets those rules out.

What a criterion is

A criterion is the condition a cell must meet before a function counts it, adds it up or averages it. It is the second half of a pair: a range to look at and a criterion to test every cell in that range against.

COUNTIF takes one pair, COUNTIFS takes up to 127. SUMIF, AVERAGEIF, SUMIFS, AVERAGEIFS, MAXIFS and MINIFS add the range that holds the numbers to work on.

Mind the order of the arguments:

  • SUMIF and AVERAGEIF: the range to test comes first, then the criterion, then the numbers (which may be left out when the tested range holds the numbers)
  • SUMIFS, AVERAGEIFS, MAXIFS and MINIFS: the numbers come first and the pairs follow

A criterion is a value, not a formula: it is either a number, a piece of text, or a text that starts with a comparison operator.

Try it yourself

Pick a column, type a criterion and see which cells COUNTIF counts.

Sheet excerpt: F2 holds the formula
RowABCDEF
1JournalDescriptionAmount
2VRKSales invoice March1,8501.850Matches33=COUNTIF(A2:A9, "x")=COUNTIF(A2:A9; "x")
3MEMCorrection VAT March-250-250
4BNKBank charges April7575
5MEMAccrual correction1,0001.000
6INKPurchase invoice2,4002.400
7Draft, number to follow
8BNKInterest received4242
9MEMDepreciation3,2003.200
Formula cell (F2)
  • Formula cell
  • Meets the criterion

=COUNTIF(A2:A9, "MEM")
=COUNTIF(A2:A9; "MEM")

Result: 33

=COUNTIF(B2:B9, "MEM")
=COUNTIF(B2:B9; "MEM")

Result: 00

=COUNTIF(C2:C9, "MEM")
=COUNTIF(C2:C9; "MEM")

Result: 00

The forms a criterion can take

Which cells qualify depends on how the criterion is written. Without an operator the cell must equal the criterion. With a comparison operator in front, Excel compares each cell with the part behind the operator. The table lists the forms you need in an audit; a pattern with * or ? is explained on the wildcards page.

CriterionCounts the cells thatTypical audit use
"MEM"equal the text MEM, in any caseOne journal (memorial entries)
5000hold the number 5000 (or the text 5000)One exact amount or account number
">1000"hold a number above 1000Amounts above a fixed threshold
">" & E1hold a number above the number in E1A threshold you can change in one cell
">=" & E1hold a number of at least the value in E1Threshold that includes the limit itself
"<>" & A1differ from the value in A1 (blank cells count)Everything except one relation or journal
">=" & DATE(2025, 12, 15)hold a date on or after 15 Dec 2025Start of a period or cut-off window
">=" & G1hold a date on or after the date in G1A period you can change in one cell
""are blank (a formula returning empty text counts too)Entries without approval
"<>"are not empty (a cell with only a space counts)Entries with an approval filled in
"25-04*"start with 25-04 (wildcard)Part of an entry number or description
=COUNTIF(B2:B100, ">1000")
=COUNTIF(B2:B100; ">1000")

Counts the amounts above 1,000. The operator and the number sit inside one pair of quotes.

=COUNTIFS(C2:C100, "MEM", D2:D100, "")
=COUNTIFS(C2:C100; "MEM"; D2:D100; "")

Counts the MEM entries where column D is blank, for example the approval column.

=COUNTIF(D2:D100, "<>")
=COUNTIF(D2:D100; "<>")

Counts the cells in column D that are not empty.

Quotes and the ampersand

Watch out: A reference inside the quotes is read as text: ">E1" looks for cells greater than the literal text E1 and finds nothing.

A comparison operator is part of the criterion, so it goes inside quotes: ">". A cell reference is not text, so it goes outside the quotes and is joined to the operator with &.

Excel glues the two together and then reads the result as one criterion. With the number 5000 in E1, ">" & E1 becomes the text >5000.

The same rule holds for every operator and for functions: ">=" & DATE(2025, 12, 15) joins the operator to a date that DATE calculates. A criterion that is already complete, such as >1000 typed in a cell, can be used by reference alone: COUNTIF(B2:B100, E1).

=COUNTIF(B2:B100, ">" & E1)
=COUNTIF(B2:B100; ">" & E1)

Right: operator in quotes, reference outside, joined with &.

=COUNTIF(B2:B100, ">E1")
=COUNTIF(B2:B100; ">E1")

Wrong: Excel compares with the text E1, so the result is 0.

=COUNTIF(A2:A100, "<>" & E1)
=COUNTIF(A2:A100; "<>" & E1)

Counts every cell that differs from E1. Empty cells differ too and are counted.

Dates in a criterion

Excel stores a date as a serial number, so a date criterion is a number criterion: ">=" & G1 joins the operator to the serial number behind the date in G1. A period needs two criteria on the same date column, one for the start (>=) and one for the end (<=). Both the first and the last day are included, which is what a cut-off test usually needs.

Do not type the date as text. A criterion such as ">=12/15/2025" is converted with the regional setting of the computer, so the same file can give different results on a colleague's laptop. A date cell or DATE(2025, 12, 15) does not depend on the setting.

If the dates carry a time of day (a posting at 31 Dec 2025 14:30), the criterion "<=" & 31 Dec 2025 misses it, because that moment is later than midnight. Use "<" & (end date + 1) instead.

=COUNTIFS(B2:B100, ">=" & G1, B2:B100, "<=" & G2)
=COUNTIFS(B2:B100; ">=" & G1; B2:B100; "<=" & G2)

Counts the dates from G1 up to and including G2.

=COUNTIFS(B2:B100, ">=" & G1, B2:B100, "<" & G2 + 1)
=COUNTIFS(B2:B100; ">=" & G1; B2:B100; "<" & G2 + 1)

The same window when the cells also hold a time of day: everything before the day after G2.

Upper case, lower case and numbers stored as text

Criteria ignore the difference between upper and lower case: mem, MEM and Mem all find the same cells. There is no switch to change this. If case matters, you need SUMPRODUCT with EXACT instead of a criterion.

Numbers stored as text (a green triangle in the corner, often after an export) behave differently per kind of criterion:

  • an exact criterion such as 5000 finds both the number 5000 and the text 5000
  • a comparison such as ">1000" looks at real numbers only, so a text 5000 is not counted
  • in the range that SUMIFS adds up, text is ignored, so a column of text amounts gives a total of 0

Convert the column first, for example by multiplying by 1 in a helper column or with Text to Columns.

Several conditions: AND and OR

Pairs in COUNTIFS, SUMIFS, AVERAGEIFS, MAXIFS and MINIFS are always combined with AND: a row counts only when every pair is met.

For OR on one column, add two functions: COUNTIFS(C2:C100, "MEM") + COUNTIFS(C2:C100, "BNK"). With more than two options, put the options in an array constant and wrap the function in SUM: SUM(COUNTIFS(C2:C100, {"MEM","BNK"})). COUNTIFS then returns one count per option and SUM adds them.

This is OR on one column. The options must exclude each other, as two different journal codes do. If one row can meet both options, the row is counted twice.

For OR across different columns (journal is MEM, or the amount is above 10,000) add the two counts and subtract the count of rows that meet both, or use SUMPRODUCT.

Ranges that must match in size

In COUNTIFS, SUMIFS, AVERAGEIFS, MAXIFS and MINIFS every range must have the same number of rows and columns, or Excel returns #VALUE!. B2:B100 with C2:C101 is already too much.

SUMIF and AVERAGEIF are less strict and therefore more dangerous: they use the upper left cell of the range to add up and take the shape of the tested range, so a range that starts one row too low does not give an error but adds the wrong rows.

Fix the ranges with absolute references ($B$2:$B$100) when you copy the formula, and give all ranges the same first and last row. A named range or a table column keeps them equal automatically.

Worked examples

Example1 of 4Beginner

Count the purchase invoices above a threshold

Veldhuis Installatie BV gave you its list of booked purchase invoices. For the detailed testing you only look at invoices above a threshold, which the team may still change. You put the threshold in E1 and want to know how many invoices fall above it, so the formula keeps working when E1 changes.

Sheet excerpt: E2 holds the formula
RowABCDEF
1Invoice no.AmountThreshold50005000
2F-2601€1,250.00€ 1.250,00Invoices above33=COUNTIF(B2:B9, ">" & E1)=COUNTIF(B2:B9; ">" & E1)
3F-2602€5,000.00€ 5.000,00
4F-2603€7,350.00€ 7.350,00
5F-2604€640.00€ 640,00
6F-2605€18,900.00€ 18.900,00
7F-2606€3,200.00€ 3.200,00
8F-2607€5,000.00€ 5.000,00
9F-2608€9,800.00€ 9.800,00
10
Formula cell (E2)Input

Formula in E2

=COUNTIF(B2:B9, ">" & E1)
=COUNTIF(B2:B9; ">" & E1)

Result: 33

Step by step
  1. E1 holds 5000. The expression ">" & E1 joins the operator in quotes to the reference outside the quotes and produces the text >5000. That text is the criterion.
  2. COUNTIF compares the eight amounts of B2:B9 with that criterion. 1,2501.250: not above 5,0005.000, no. 5,0005.000 (B3): equal to 5,0005.000, not above it, no.
  3. The other amounts:

    • 7,3507.350 (B4): yes
    • 640: no
    • 18,90018.900 (B6): yes
    • 3,2003.200: no
    • 5,0005.000 (B8): equal, no
    • 9,8009.800 (B9): yes
  4. Three amounts pass (7,3507.350, 18,90018.900 and 9,8009.800), so the result is 3. The two invoices of exactly 5,0005.000 do not count, because the operator is > and not >=.
  5. Type 3000 in E1 and the criterion becomes >3000: the result is 6. The formula follows the cell.

Watch out: Whether the limit itself counts is an audit decision. If the program says "5,0005.000 and above", > gives 3 and misses two invoices. Check the wording of the threshold before you choose the operator.

More on this example: why it works, 2 variations

Why it works

The criterion is a text with an operator at the front, and COUNTIF reads it as a comparison. Because the number comes from a cell, the threshold is visible and can be changed, instead of being hidden inside the formula.

Variations

=COUNTIF(B2:B9, ">=" & E1)
=COUNTIF(B2:B9; ">=" & E1)

Includes the limit itself. The result is 5, because the two invoices of 5,0005.000 now count.

=SUMIF(B2:B9, ">" & E1)
=SUMIF(B2:B9; ">" & E1)

Adds up the amounts above the threshold instead of counting them: 7,3507.350 + 18,90018.900 + 9,8009.800 = 36,05036.050. With one range, SUMIF adds the cells that pass.

Example2 of 4Intermediate

Find memorial entries without an approval

In the journal of Veldhuis Installatie BV the column Approved by should hold the initials of the person who approved a manual entry. As part of journal entry testing you want to know how many MEM entries have no approval, and what they add up to, because those are the entries to test first.

Sheet excerpt: F2 holds the formula
RowABCDEFG
1Entry no.JournalAmountApproved byMEM without approval
225-0901MEM€4,200.00€ 4.200,00J. Mulder22=COUNTIFS(B2:B9, "MEM", D2:D9, "")=COUNTIFS(B2:B9; "MEM"; D2:D9; "")
325-0902BNK€1,800.00€ 1.800,00
425-0903MEM€12,900.00€ 12.900,00
525-0904MEM€760.00€ 760,00J. Mulder
625-0905VRK€5,400.00€ 5.400,00
725-0906MEM€3,350.00€ 3.350,00
825-0907MEM€21,500.00€ 21.500,00L. Kok
925-0908BNK€640.00€ 640,00L. Kok
10
Formula cell (F2)InputNote: The blank cells in column D are truly empty.

Formula in F2

=COUNTIFS(B2:B9, "MEM", D2:D9, "")
=COUNTIFS(B2:B9; "MEM"; D2:D9; "")

Result: 22

Step by step
  1. COUNTIFS has two pairs. The first tests B2:B9 for the text MEM, the second tests D2:D9 for "", the criterion for a blank cell. A row only counts when both pairs are met.
  2. Rows with journal MEM: 25-0901, 25-0903, 25-0904, 25-0906 and 25-0907. The other three (BNK, VRK, BNK) fail the first pair.
  3. Of those five rows:

    • D2 (J. Mulder) is filled: no
    • D4 is empty: yes
    • D5 (J. Mulder) is filled: no
    • D7 is empty: yes
    • D8 (L. Kok) is filled: no
  4. Two rows pass both pairs, 25-0903 and 25-0906, so the result is 2. The empty cells in D3 (BNK) and D6 (VRK) do not count, because their journal is not MEM.
  5. The amount: 12,90012.900 + 3,3503.350 = 16,25016.250, which is what the SUMIFS variation below gives.

Watch out: A cell that looks blank but holds a space, or a formula that returns empty text, is not truly empty. "" counts the formula result as blank, but "<>" counts it as filled, and a cell with only a space is neither found by "" nor ignored by "<>". If the result looks too low, check the column with LEN.

More on this example: why it works, 2 variations

Why it works

The criterion "" matches a cell that holds nothing. Combined with the journal in a second pair, COUNTIFS applies AND, so a blank approval on a bank entry does not distract from the manual entries you are after.

Variations

=COUNTIFS(B2:B9, "MEM", D2:D9, "<>")
=COUNTIFS(B2:B9; "MEM"; D2:D9; "<>")

Counts the MEM entries with an approval filled in: 25-0901, 25-0904 and 25-0907, so 3. Together with the 2 above this makes the 5 MEM entries.

=SUMIFS(C2:C9, B2:B9, "MEM", D2:D9, "")
=SUMIFS(C2:C9; B2:B9; "MEM"; D2:D9; "")

The amount of the unapproved MEM entries: 12,90012.900 + 3,3503.350 = 16,25016.250. The numbers to add come first in SUMIFS.

Example3 of 4Intermediate

Add up memorial entries in a window around year end

For the year-end work on Veldhuis Installatie BV you review the manual entries booked in the second half of December 2025. The window runs from 15 Dec 2025 up to and including 31 Dec 2025 and sits in two cells, so the same formula serves a different window later. You want the total of the MEM entries in that window.

Sheet excerpt: G3 holds the formula
RowABCDEFGH
1Entry no.DateJournalAmountFrom15 Dec 2025
225-118812 Dec 2025MEM€2,400.00€ 2.400,00Up to and including31 Dec 2025
325-120418 Dec 2025BNK€8,600.00€ 8.600,00MEM total€28,690.00€ 28.690,00=SUMIFS(D2:D9, C2:C9, "MEM", B2:B9, ">=" & G1, B2:B9, "<=" & G2)=SUMIFS(D2:D9; C2:C9; "MEM"; B2:B9; ">=" & G1; B2:B9; "<=" & G2)
425-121923 Dec 2025MEM€15,750.00€ 15.750,00
525-123129 Dec 2025MEM€3,100.00€ 3.100,00
625-124031 Dec 2025MEM€9,200.00€ 9.200,00
726-00032 Jan 2026MEM€4,500.00€ 4.500,00
826-00115 Jan 2026BNK€1,200.00€ 1.200,00
925-119515 Dec 2025MEM€640.00€ 640,00
10
Formula cell (G3)InputNote: The dates are real date values in Excel, so enter them as dates when you rebuild the sheet.

Formula in G3

=SUMIFS(D2:D9, C2:C9, "MEM", B2:B9, ">=" & G1, B2:B9, "<=" & G2)
=SUMIFS(D2:D9; C2:C9; "MEM"; B2:B9; ">=" & G1; B2:B9; "<=" & G2)

Result: €28,690.00€ 28.690,00

Step by step
  1. SUMIFS adds up D2:D9, the amounts, for the rows that meet all three pairs. The first pair tests the journal in C2:C9 for MEM.
  2. The second pair is ">=" & G1. G1 holds 15 Dec 2025, so the criterion is the text >= followed by the serial number of that date. The third, "<=" & G2, does the same for 31 Dec 2025. Both the first and the last day are included.
  3. Row by row:

    • 25-1188 (12 Dec, MEM) is before the window: no
    • 25-1204 (18 Dec) is BNK: no
    • 25-1219 (23 Dec, MEM): yes, 15,75015.750
    • 25-1231 (29 Dec, MEM): yes, 3,1003.100
  4. 25-1240 (31 Dec, MEM): yes, 9,2009.200, the last day counts because of <=. 26-0003 (2 Jan 2026) is after the window: no. 26-0011 (BNK): no. 25-1195 (15 Dec, MEM): yes, 640, the first day counts because of >=.
  5. 15,75015.750 + 3,1003.100 + 9,2009.200 + 640 = 28,69028.690. Four entries pass.

Watch out: With "<" & G2 instead of "<=" the last day falls out: 25-1240 of 31 Dec is lost and the total becomes 19,49019.490. A cut-off window is exactly where the boundary days matter. Also check whether the dates carry a time of day; then use "<" & (G2 + 1).

More on this example: why it works, 2 variations

Why it works

A date is a number, so a period is two number criteria on the same column, combined with AND. Joining the limits from cells with & keeps the window visible and editable. The order of the entries does not matter, because every row is tested on its own.

Variations

=COUNTIFS(C2:C9, "MEM", B2:B9, ">=" & G1, B2:B9, "<=" & G2)
=COUNTIFS(C2:C9; "MEM"; B2:B9; ">=" & G1; B2:B9; "<=" & G2)

Counts the entries instead of adding them up: 4.

=SUMIFS(D2:D9, C2:C9, "MEM", B2:B9, ">=" & DATE(2025, 12, 15), B2:B9, "<=" & DATE(2025, 12, 31))
=SUMIFS(D2:D9; C2:C9; "MEM"; B2:B9; ">=" & DATE(2025; 12; 15); B2:B9; "<=" & DATE(2025; 12; 31))

The same total with DATE in the formula. Use it for a fixed window; the cells in the example are better when the window changes.

Example4 of 4Advanced

Count large entries in two journals since 1 December

In the journal of Veldhuis Installatie BV you select the entries for testing: booked in the MEM or the BNK journal, dated on or after 1 Dec 2025, and with an amount of at least the threshold of 10,00010.000. The journal is an OR (two codes), the date and the amount are AND conditions. You want the number of entries to be tested.

Sheet excerpt: G3 holds the formula
RowABCDEFGH
1Entry no.JournalDateAmountFrom1 Dec 2025
225-1101VRK3 Dec 2025€18,400.00€ 18.400,00Amount from1000010000
325-1102MEM9 Dec 2025€12,500.00€ 12.500,00Entries44=SUM(COUNTIFS(B2:B9, {"MEM","BNK"}, C2:C9, ">=" & G1, D2:D9, ">=" & G2))=SUM(COUNTIFS(B2:B9; {"MEM"\"BNK"}; C2:C9; ">=" & G1; D2:D9; ">=" & G2))
425-1103BNK10 Dec 2025€9,800.00€ 9.800,00
525-1104INK28 Nov 2025€22,000.00€ 22.000,00
625-1105BNK17 Dec 2025€14,300.00€ 14.300,00
725-1106MEM20 Nov 2025€30,000.00€ 30.000,00
825-1107MEM22 Dec 2025€10,000.00€ 10.000,00
925-1108BNK30 Dec 2025€25,600.00€ 25.600,00
10
Formula cell (G3)InputNote: The dates are real date values in Excel, so enter them as dates when you rebuild the sheet.

Formula in G3

=SUM(COUNTIFS(B2:B9, {"MEM","BNK"}, C2:C9, ">=" & G1, D2:D9, ">=" & G2))
=SUM(COUNTIFS(B2:B9; {"MEM"\"BNK"}; C2:C9; ">=" & G1; D2:D9; ">=" & G2))

Result: 44

Step by step
  1. The array constant {"MEM","BNK"} makes COUNTIFS run twice: once with the journal criterion MEM and once with BNK. The date and amount criteria stay the same in both runs.
  2. The criteria are >= followed by the serial number of 1 Dec 2025 (from G1) and >=10000 (from G2).
  3. Run MEM: 25-1102 (9 Dec, 12,50012.500): yes. 25-1106 (20 Nov, 30,00030.000): before 1 Dec, no. 25-1107 (22 Dec, 10,00010.000): yes, because the amount equals the limit and the operator is >=. COUNTIFS returns 2.
  4. Run BNK: 25-1103 (10 Dec, 9,8009.800): below 10,00010.000, no. 25-1105 (17 Dec, 14,30014.300): yes. 25-1108 (30 Dec, 25,60025.600): yes. COUNTIFS returns 2.
  5. COUNTIFS now returns the array {2, 2}. SUM adds the two counts: 2 + 2 = 4. The VRK and INK entries never take part, whatever their amount.

Watch out: Without SUM the formula returns two numbers. In current Excel they spill into two cells, in older versions you see only the first count, and in both cases the total is not what you wanted.

More on this example: why it works, 1 more pitfall, 2 variations

Why it works

A criterion that is an array makes COUNTIFS return an array with one count per element. SUM turns that into one number, which is OR for criteria that exclude each other. The other pairs apply to every element, so AND and OR sit in one formula.

More to watch out for

  • The options must not overlap. For two journal codes they cannot, because an entry has one journal. For "MEM or amount above 10,00010.000" the same trick would count an entry that meets both twice.

Variations

=COUNTIFS(B2:B9, "MEM", C2:C9, ">=" & G1, D2:D9, ">=" & G2) + COUNTIFS(B2:B9, "BNK", C2:C9, ">=" & G1, D2:D9, ">=" & G2)
=COUNTIFS(B2:B9; "MEM"; C2:C9; ">=" & G1; D2:D9; ">=" & G2) + COUNTIFS(B2:B9; "BNK"; C2:C9; ">=" & G1; D2:D9; ">=" & G2)

The same 4 with two functions added up. Longer, but clear with two options and the usual way when the options sit in different columns.

=SUMPRODUCT(COUNTIFS(B2:B9, {"MEM","BNK"}, C2:C9, ">=" & G1, D2:D9, ">=" & G2))
=SUMPRODUCT(COUNTIFS(B2:B9; {"MEM"\"BNK"}; C2:C9; ">=" & G1; D2:D9; ">=" & G2))

SUM(COUNTIFS(...)) with an array constant like {"MEM","BNK"} works without Ctrl+Shift+Enter. SUMPRODUCT gives the same 4 and matters when the options come from a range in older Excel.

Common mistakes

Common mistakes
SymptomCauseFix
COUNTIF returns 0 although amounts are above the thresholdCOUNTIF(B2:B100, ">E1") returns 0 although several amounts are above the threshold in E1.Take the reference out of the quotes and join it: ">" & E1.
The postings of the last day of the period are missingA period from 1 Dec 2025 to 31 Dec 2025 misses the postings of 31 December.Either the end criterion is "<" instead of "<=", or the cells hold a time of day and 31 Dec 14:30 is later than the date 31 Dec at midnight. Use "<=" for dates without time, and "<" & (end date + 1) for dates with time.
#VALUE! although every criteria pair looks rightCOUNTIFS or SUMIFS returns #VALUE! although every pair looks right.The ranges differ in size, for example B2:B100 next to C2:C99. Give every range the same first and last row. SUMIF does not report the same mistake: it silently adds the wrong rows.
SUMIFS returns 0 on a column that is full of numbersSUMIFS over a column of amounts returns 0, and ">1000" counts nothing, although the column is full of numbers.The amounts are text after an export. Comparisons and sums ignore text. Convert the column to real numbers first, then test with a few cells and ISNUMBER.
A not-equal criterion counts more than expected"<>" & A1 counts more than expected.Empty cells also differ from A1, so they are counted. Add a second pair that excludes them, for example COUNTIFS(A2:A100, "<>" & A1, A2:A100, "<>").
Adding two COUNTIFS for an OR gives a total that is too highYou want entries from the MEM journal or with an amount above 10,000, so you add two COUNTIFS, and the total is too high.An entry that meets both conditions is counted twice. Subtract the count of entries that meet both, or use SUMPRODUCT with the two conditions.

Back to the glossary