Available in:Excel 2019 or later (Works in Excel 2019, every later version, Microsoft 365 and Excel for the web)Examples need Excel 2021 or laterCategory:Statistical

MAXIFS

MAX.ALS.VOORWAARDEN in Dutch Excel

Returns the largest number among the rows that meet one or more conditions, and 0 when no row qualifies.

Difficulty rating 3 of 5. The pattern is the same as SUMIFS, but a result of 0 can be a real figure or the sign that no row matched, and nothing warns you which of the two it is.

Last updated: 13 October 2026

See the worked examples

Sheet excerpt: F2 holds the formula
RowABCDEF
1SupplierDateAmountSupplierRoelofs BV
2Dekker BV6 Oct 2025€3,800.00€ 3.800,00Largest€5,640.00€ 5.640,00=MAXIFS(C2:C7, A2:A7, F1)=MAXIFS(C2:C7; A2:A7; F1)
3Roelofs BV14 Oct 2025€1,275.50€ 1.275,50
4Hermans BV21 Oct 2025€8,900.00€ 8.900,00
5Roelofs BV4 Nov 2025€5,640.00€ 5.640,00
6Dekker BV18 Nov 2025€2,960.25€ 2.960,25
7Roelofs BV9 Dec 2025€3,115.00€ 3.115,00
Formula cell (F2)Input

Result: €5,640.00€ 5.640,00

=MAXIFS(C2:C7, A2:A7, F1)
=MAXIFS(C2:C7; A2:A7; F1)

What MAXIFS does and when to use it

What it does: it returns the largest value among the rows that meet your criteria, for example the latest posting date on an account.

When to use it: when you need the highest value per group, such as the largest payment to a supplier or the most recent invoice per customer. It replaces the array formula MAX(IF(...)) and needs no Ctrl+Shift+Enter.

Two main gains:

  • No array formula: MAXIFS is confirmed with Enter, where MAX(IF(...)) needs Ctrl+Shift+Enter in older versions.
  • Several conditions in one formula: you add pairs of range and condition instead of nesting IF inside MAX.

How Excel evaluates it

Excel reads max_range and then the first pair. Row by row it tests the cell in criteria_range1 against criteria1, and a row that passes stays in. With more pairs, a row must pass every test. Excel then takes the largest number among the max_range cells of the rows that stayed in.

Watch out: When no row meets the conditions, MAXIFS returns 0 and not an error, so a result of 0 can mean that nothing matched.

Mental model

Filter the table with your conditions and glance at the biggest number left in the column. If the filter leaves nothing, the glance gives 0.

Terms used on this page: criteria, array, range, cell

MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
MAXIFS(max_range; criteria_range1; criteria1; [criteria_range2; criteria2]; ...)
Arguments
ArgumentTypeMeaning
max_rangeRequiredThe cells the largest value is taken from.
criteria_range1RequiredThe range the first condition is tested against.
criteria1RequiredThe condition: a value, a cell reference or text such as ">=100".
criteria_range2OptionalAn optional second range to test; same size as the first.
criteria2OptionalThe condition that goes with the second range.

Return value:A number: the largest value among matching rows, or 0 if none match

Formulas use commas (,) between arguments, as in English Excel. Formulas use semicolons (;) between arguments, as in Dutch Excel. Formulas use commas (,) between arguments, as in English Excel; Dutch Excel uses semicolons (;).

Worked examples

Beginner

Largest payment to one supplier

For the purchases cycle at Veldhuis Installatie BV you have the bank payments to three suppliers in the last quarter of 2025. You want the largest single payment to the supplier named in F1, to compare with the approval limit for payments. MAX without a condition would return the largest payment of all suppliers together.

Sheet excerpt: F2 holds the formula
RowABCDEFG
1SupplierDateAmountSupplierRoelofs BV
2Dekker BV6 Oct 2025€3,800.00€ 3.800,00Largest€5,640.00€ 5.640,00=MAXIFS(C2:C7, A2:A7, F1)=MAXIFS(C2:C7; A2:A7; F1)
3Roelofs BV14 Oct 2025€1,275.50€ 1.275,50
4Hermans BV21 Oct 2025€8,900.00€ 8.900,00
5Roelofs BV4 Nov 2025€5,640.00€ 5.640,00
6Dekker BV18 Nov 2025€2,960.25€ 2.960,25
7Roelofs BV9 Dec 2025€3,115.00€ 3.115,00
8
Formula cell (F2)Input

Formula in F2

=MAXIFS(C2:C7, A2:A7, F1)
=MAXIFS(C2:C7; A2:A7; F1)

Result: €5,640.00€ 5.640,00

Step by step
  1. Excel reads F1 and finds Roelofs BV. That is criteria1, and it is tested against A2:A7.
  2. It tests A2:A7 row by row:

    • A2 is Dekker, no
    • A3 is Roelofs, yes
    • A4 is Hermans, no
    • A5 is Roelofs, yes
    • A6 is Dekker, no
    • A7 is Roelofs, yes

    Rows 3, 5 and 7 stay in.

  3. From C2:C7 Excel now looks at the cells of those rows only: C3 is 1,275.501.275,50, C5 is 5,640.005.640,00 and C7 is 3,115.003.115,00.
  4. The largest of the three is 5,640.005.640,00, so F2 shows 5,640.005.640,00. The payment of 8,900.008.900,00 is larger, but it belongs to Hermans BV and plays no part.
  5. Change F1 to Dekker BV and the result becomes 3,800.003.800,00, the larger of 3,800.003.800,00 and 2,960.252.960,25.

Watch out: Type a supplier name that is not in the list, or one with a space at the end, and the result is 0, not an error. A real payment of 0.00 would look the same, so check the name whenever you see 0.

More on this example: why it works, 1 variation

Why it works

max_range and criteria_range1 have the same height, so the third row of one is the third row of the other. The condition selects rows first and the maximum is taken afterwards, which is why a larger payment to another supplier cannot leak into the answer.

Variations

=MAX(C2:C7)
=MAX(C2:C7)

Without the supplier condition you get the largest payment overall, 8,900.008.900,00. Use it as a comparison base.

Intermediate

Latest invoice date per customer up to the cut-off

For the cut-off test on sales you want, for one customer, the date of the most recent sales invoice on or before the balance sheet date of 31 December 2025.

The list also holds invoices from January 2026. They belong to the next year and must not count. The formula sits in F4 and is meant to be copied down for more customers, so the ranges are locked.

Sheet excerpt: F4 holds the formula
RowABCDEFG
1Invoice no.CustomerInvoice dateCut-off date31 Dec 2025
2F-25-0381Jansen Dakbedekking BV14 Nov 2025
3F-25-0392Visser Metaalbouw BV9 Dec 2025CustomerLatest invoice
4F-25-0407Jansen Dakbedekking BV22 Dec 2025Jansen Dakbedekking BV22 Dec 202522 Dec 2025=MAXIFS($C$2:$C$8, $B$2:$B$8, E4, $C$2:$C$8, "<="&$F$1)=MAXIFS($C$2:$C$8; $B$2:$B$8; E4; $C$2:$C$8; "<="&$F$1)
5F-26-0003Jansen Dakbedekking BV8 Jan 2026
6F-25-0415Visser Metaalbouw BV30 Dec 2025
7F-25-0371Mulder Kozijnen BV27 Oct 2025
8F-26-0001Visser Metaalbouw BV5 Jan 2026
9
Formula cell (F4)Input

Formula in F4

=MAXIFS($C$2:$C$8, $B$2:$B$8, E4, $C$2:$C$8, "<="&$F$1)
=MAXIFS($C$2:$C$8; $B$2:$B$8; E4; $C$2:$C$8; "<="&$F$1)

Result: 22 Dec 202522 Dec 2025

Step by step
  1. Excel reads the first pair: criteria_range1 is B2:B8 and criteria1 is E4, Jansen Dakbedekking BV. Rows 2, 4 and 5 have that customer: B2, B4 and B5.
  2. Excel reads the second pair. F1 holds 31 December 2025, which is the serial number 46022. The & turns it into the text "<=46022", so a row passes when its date in C is 46022 or lower.
  3. Of the three Jansen rows, C2 (14 November 2025, 45975) and C4 (22 December 2025, 46013) pass. C5 (8 January 2026, 46030) fails the date test and drops out. A row must pass both tests.
  4. The largest of 45975 and 46013 is 46013, so F4 shows 22 December 2025. Without the second pair the answer would be 8 January 2026, an invoice that belongs to the next year.
  5. Type Visser Metaalbouw BV in E4 and F4 shows 30 December 2025: the invoice of 5 January 2026 is out, 9 December and 30 December are in.

Watch out: Write "<=F1" without the & and Excel compares with the text F1. No date passes and the result is 0, which a date format shows as 0 January 1900.

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

Why it works

The date column is both the range to take the maximum from and a criteria range. That is allowed: Excel first selects the rows that pass the cut-off, then takes the maximum of those same dates. The $ signs keep all three ranges in place when you copy the formula down, while E4 moves along to the next customer.

More to watch out for

  • Invoice dates that came in as text from an export are skipped silently: the customer then seems to have no invoice or an older one. Check the column with COUNT or look for left-aligned dates.

Variations

=MAXIFS($C$2:$C$8, $B$2:$B$8, E4)
=MAXIFS($C$2:$C$8; $B$2:$B$8; E4)

Without the cut-off you get the latest invoice of any date, 8 January 2026 for Jansen. Use it for a first look, never for the cut-off test.

Advanced

Test whether a supplier invoices close to the approval limit

In the purchases cycle every invoice of 10,000.0010.000,00 or more needs approval from the directors. You test whether the supplier in F1 stays close to that limit on purpose, which can point to split invoices.

You want the largest invoice below the limit in F2, and a flag when it lies within the margin in F3 (5%) of the limit.

Sheet excerpt: F4 holds the formula
RowABCDEFG
1SupplierInvoice no.AmountSupplierDijkman Bouwstoffen BV
2Dijkman Bouwstoffen BVINK-5102€9,650.00€ 9.650,00Approval limit1000010000
3Brouwer Installatie BVINK-5103€14,200.00€ 14.200,00Margin0.050,05
4Dijkman Bouwstoffen BVINK-5107€11,800.00€ 11.800,00CheckNear the limit=IF(MAXIFS(C2:C9, A2:A9, F1, C2:C9, "<"&F2) >= F2 * (1 - F3), "Near the limit", "Clear of the limit")=IF(MAXIFS(C2:C9; A2:A9; F1; C2:C9; "<"&F2) >= F2 * (1 - F3); "Near the limit"; "Clear of the limit")
5Dijkman Bouwstoffen BVINK-5111€9,890.00€ 9.890,00
6Smit Gereedschap BVINK-5112€4,350.00€ 4.350,00
7Dijkman Bouwstoffen BVINK-5118€7,200.00€ 7.200,00
8Brouwer Installatie BVINK-5121€9,940.00€ 9.940,00
9Dijkman Bouwstoffen BVINK-5125€12,500.00€ 12.500,00
10
Formula cell (F4)Input

Formula in F4

=IF(MAXIFS(C2:C9, A2:A9, F1, C2:C9, "<"&F2) >= F2 * (1 - F3), "Near the limit", "Clear of the limit")
=IF(MAXIFS(C2:C9; A2:A9; F1; C2:C9; "<"&F2) >= F2 * (1 - F3); "Near the limit"; "Clear of the limit")

Result: Near the limit

Step by step
  1. Excel reads F1 (Dijkman Bouwstoffen BV), F2 (10000) and F3 (0.05). The test of IF starts with MAXIFS, which has two pairs: A2:A9 against F1, and C2:C9 against the text "<10000" that the & builds from F2.
  2. The supplier test keeps rows 2, 4, 5, 7 and 9, with amounts 9,650.009.650,00, 11,800.0011.800,00, 9,890.009.890,00, 7,200.007.200,00 and 12,500.0012.500,00.
  3. The amount test removes 11,800.0011.800,00 and 12,500.0012.500,00, because those invoices were above the limit and had to be approved anyway. Left are 9,650.009.650,00, 9,890.009.890,00 and 7,200.007.200,00, so MAXIFS returns 9,890.009.890,00. The Brouwer invoice of 14,200.0014.200,00 and the Smit invoice play no part.
  4. The other side of the comparison is F2 * (1 - F3) = 10,00010.000 * 0.95 = 9,500.009.500,00, the lowest amount that counts as near the limit.
  5. 9,890.009.890,00 >= 9,500.009.500,00 is TRUE, so IF returns its second argument and F4 shows Near the limit.
  6. Change F1 to Smit Gereedschap BV: the only invoice is 4,350.004.350,00, which is below 9,500.009.500,00, so F4 shows Clear of the limit. Brouwer Installatie BV gives 9,940.009.940,00 and Near the limit.

Watch out: A supplier with no invoice below the limit, or a name with a typo, gives 0 from MAXIFS. Since 0 is below 9,500.009.500,00 the flag reads Clear of the limit without any error, so a clear result is only as reliable as the supplier name in F1.

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

Why it works

The amount column is both max_range and a criteria range, which MAXIFS allows. The condition "<"&F2 removes the invoices that already needed approval before the maximum is taken, so a large approved invoice cannot hide the one closest below the limit. The limit and the margin sit in cells, so a change of policy needs no formula edit.

More to watch out for

  • Write "<="&F2 and an invoice of exactly 10,000.0010.000,00 counts as below the limit, although it needed approval. It would be flagged as Near the limit for the wrong reason.
  • Amounts stored as text (for example from an export) are skipped by MAXIFS, so the largest invoice below the limit can be too low and the flag stays clear. Check the amount column with COUNT.

Variations

=MAXIFS(C2:C9, A2:A9, F1, C2:C9, "<"&F2)
=MAXIFS(C2:C9; A2:A9; F1; C2:C9; "<"&F2)

The amount itself instead of the flag: 9,890.009.890,00 for Dijkman. Use it when you want to read the figure.

=COUNTIFS(A2:A9, F1, C2:C9, ">="&F2 * (1 - F3), C2:C9, "<"&F2)
=COUNTIFS(A2:A9; F1; C2:C9; ">="&F2 * (1 - F3); C2:C9; "<"&F2)

Counts the invoices in the band from 9,500.009.500,00 up to the limit: 2 for Dijkman (9,650.009.650,00 and 9,890.009.890,00). Several invoices in that band are stronger evidence of splitting than one.

MasterExcel 2021 or later (This example needs Excel 2021 or later)

Days since the last qualifying payment per supplier

For a test on inactive suppliers at 31 December 2025 you want, for each supplier in the master data, the number of days since the last payment of at least 1,000.001.000,00 on or before the report date.

A supplier without such a payment must read 'No payment' and not 'days since 30 December 1899'. Payments after the report date are subsequent events and must not count.

Sheet excerpt: F2 holds the formula
RowABCDEFGHI
1SupplierPayment dateAmountSupplierDays since last paymentReport date31 Dec 2025
2Bakker Elektro BV12 Sep 2025€4,200.00€ 4.200,00Bakker Elektro BV2626=LET( suppliers, E2:E5, cutoff, H1, minAmt, H2, last, MAXIFS(B2:B9, A2:A9, suppliers, B2:B9, "<="&cutoff, C2:C9, ">="&minAmt), IF(last = 0, "No payment", cutoff - last) )=LET( suppliers; E2:E5; cutoff; H1; minAmt; H2; last; MAXIFS(B2:B9; A2:A9; suppliers; B2:B9; "<="&cutoff; C2:C9; ">="&minAmt); IF(last = 0; "No payment"; cutoff - last) )Minimum payment10001000
3Kuipers Kabel BV20 Oct 2025€6,325.00€ 6.325,00Kuipers Kabel BV4747
4Bakker Elektro BV5 Dec 2025€3,150.00€ 3.150,00Sanders Leidingwerk BV149149
5Kuipers Kabel BV18 Dec 2025€250.00€ 250,00Hofman Isolatie BVNo payment
6Sanders Leidingwerk BV4 Aug 2025€9,600.00€ 9.600,00
7Bakker Elektro BV9 Jan 2026€5,100.00€ 5.100,00
8Kuipers Kabel BV14 Nov 2025€2,740.75€ 2.740,75
9Sanders Leidingwerk BV29 Aug 2025€780.00€ 780,00
10
Formula cell (F2)InputSpilled resultNote: In a real sheet the payment list would run to row 5,000. The supplier list in E2:E5 would come from the master data.

Formula in F2

=LET(
  suppliers, E2:E5,
  cutoff, H1,
  minAmt, H2,
  last, MAXIFS(B2:B9, A2:A9, suppliers, B2:B9, "<="&cutoff, C2:C9, ">="&minAmt),
  IF(last = 0, "No payment", cutoff - last)
)
=LET(
  suppliers; E2:E5;
  cutoff; H1;
  minAmt; H2;
  last; MAXIFS(B2:B9; A2:A9; suppliers; B2:B9; "<="&cutoff; C2:C9; ">="&minAmt);
  IF(last = 0; "No payment"; cutoff - last)
)

Result: 26, 47, 149 and No payment26. 47. 149 and No payment

Step by step
  1. LET reads its arguments in pairs. suppliers becomes E2:E5, cutoff becomes H1 (31 December 2025, serial 46022) and minAmt becomes H2 (1000). Nothing is calculated yet.
  2. The fourth pair defines last. MAXIFS gets a range as its first criterion, so it runs once per supplier, each time with three tests: supplier equal to the name, date "<=46022" and amount ">=1000".
  3. The three tests leave these rows per supplier:

    • Bakker: row 7 (9 January 2026) fails the date test and rows 2 and 4 pass; the latest of 12 September (45912) and 5 December 2025 (45996) is 45996
    • Kuipers: row 5 (250.00) fails the amount test and rows 3 and 8 pass; the latest is 14 November 2025 (45975)
    • Sanders: row 9 (780.00) fails the amount test and row 6 passes: 4 August 2025 (45873)
    • Hofman: no rows at all, so 0
  4. last is now the column 45996, 45975, 45873, 0. The last argument of LET is the calculation. IF tests last = 0 for each element: FALSE, FALSE, FALSE, TRUE.
  5. For the first three, Excel calculates 46022 - last: 26, 47 and 149 days. For Hofman it returns the text No payment. The four results spill into F2:F5.
  6. Set H1 to 31 January 2026 (serial 46053) and the 9 January payment of Bakker counts: the result for Bakker becomes 46053 - 46031 = 22 days.

Watch out: The mirror image looks right: write ">="&cutoff instead of "<="&cutoff and the formula sees only payments after the report date. With these rows it returns -9 for Bakker (its payment of 9 January 2026) and No payment for the other three suppliers. On a long list this can pass for an exception report, so always test with a payment dated after the report date.

More on this example: why it works, 2 more pitfalls, 1 variation

Why it works

A genuine last-payment date is a serial number far above 0, so a result of 0 can only mean 'nothing matched', and the IF turns that into text in one place. LET names the three inputs once, so the conditions read like the audit procedure and a reviewer changes the report date in a single cell.

Do not use this construction when you also need the reference or amount of that last payment: MAXIFS returns only the date. Use FILTER with TAKE, or a PivotTable with the maximum of the payment date per supplier; the PivotTable needs a refresh after the data changes but copes better with thousands of suppliers than one MAXIFS per supplier.

More to watch out for

  • Payment dates stored as text (a typical result of an export) are skipped by MAXIFS, so a supplier that paid last month reads 'No payment'. Check the date column with COUNT.
  • LET and a spilled result need Microsoft 365 or Excel 2021. In Excel 2019 build one formula per supplier without LET.

Variations

=MAXIFS(B2:B9, A2:A9, E2, B2:B9, "<="&H1, C2:C9, ">="&H2)
=MAXIFS(B2:B9; A2:A9; E2; B2:B9; "<="&H1; C2:C9; ">="&H2)

One supplier per formula, without LET. The 0 for 'no payment' still has to be caught separately.

Try it yourself

Type a criterion for the amount and see the largest invoice that still passes it.

Sheet excerpt: F2 holds the formula
RowABCDEF
1SupplierDateAmount
2Dekker BV6 Oct 2025€3,800.00€ 3.800,00Largest€3,800.00€ 3.800,00=MAXIFS(C2:C8, C2:C8, "x")=MAXIFS(C2:C8; C2:C8; "x")
3Roelofs BV14 Oct 2025€1,275.50€ 1.275,50
4Hermans BV21 Oct 2025€8,900.00€ 8.900,00
5Roelofs BV4 Nov 2025€5,640.00€ 5.640,00
6Dekker BV18 Nov 2025€2,960.25€ 2.960,25
7Roelofs BV9 Dec 2025€3,115.00€ 3.115,00
8Hermans BV15 Dec 2025€480.00€ 480,00
Formula cell (F2)
  • Formula cell
  • Meets the criterion

=MAXIFS(C2:C8, C2:C8, "<5000")
=MAXIFS(C2:C8; C2:C8; "<5000")

Result: €3,800.00€ 3.800,00

Common mistakes

Common mistakes
SymptomCauseFix
#NAME? in Excel 2016 or earlierThe workbook is opened in Excel 2016 or earlier and the cell shows #NAME?, because MAXIFS does not exist there.The function arrived in Excel 2019. For older versions use =MAX(IF(...)) confirmed with Ctrl+Shift+Enter, or AGGREGATE with function_num 14 and option 6, which skips errors.
0 shown although no row matchesA 0 is read as a real maximum, while no row met the conditions (a supplier name with a typo or a trailing space). Formatted as a date, that 0 shows as 0 January 1900.Count the matching rows with COUNTIFS and the same conditions, or wrap the formula: IF(COUNTIFS(...) = 0, "No match", MAXIFS(...)).
#VALUE! with ranges of different sizeThe ranges differ in size, for example C2:C9 for max_range and A2:A8 for criteria_range1, and the result is #VALUE!.Select the same rows in every range, and lock them with $ when you copy the formula down.
0 although rows should matchAn operator is written against a cell without &, such as "<=F1". Excel compares with the text F1, nothing matches and the result is 0.Write the operator in quotes and join the cell: "<="&F1.