Excel Guide · Prompt: “Find the highest deal amount in C2:C6 where Region in B2:B6 is North America”

Find Conditional Maximum Value in Excel with MAXIFS

Verified by LiveFormulaLab Engineering Team • Updated November 2026

Find the largest value matching one or more criteria in Excel using MAXIFS. Copy the formula and compare SQL and Python equivalents.

Verified Excel Syntax

=IF(B2="North America", C2, 0)

How This Formula Works (Step-by-Step)

When you need the highest sale, latest date, or peak score for a specific category, MAXIFS evaluates conditions before returning the maximum value.

Step 1: In Excel 2019/365, call =MAXIFS(C2:C6, B2:B6, "North America").

Step 2: In row-level filtering or legacy Excel, isolate matching values with IF before taking MAX.

Formula Syntax & Arguments Breakdown

Evaluates conditional peak values either per-row via IF(condition, value, 0) or across an entire column via MAXIFS(max_range, criteria_range, criteria).

Argument / ClauseRequirementData TypeRole & Behavior
logical_test / criteria_range (B2="North America")RequiredBoolean / RangeCondition or category range determining which rows qualify for maximum comparison.
value_if_true / max_range (C2 or C2:C6)RequiredNumeric Cell / RangeMetric (Revenue, Score, Latency) evaluated when the condition holds true.
value_if_false (0)OptionalFallback ValueNeutral value returned on non-matching rows in row-level IF filtering before MAX aggregation.

3 Real-World Use Cases

  • Finding the largest closed contract per sales region.
  • Identifying the most recent order date for each customer account.
  • Extracting peak server latency recorded during production hours.

Cross-Platform Equivalents

Excel
=MAXIFS(C2:C6, B2:B6, "North America")
SQL
SELECT MAX(deal_size) FROM pipeline WHERE region = 'North America';
Python Pandas
df[df['Region'] == 'North America']['Deal Size'].max()

Common Mistakes & Pro Tips

Pitfalls & How to Fix Them

  • Mistake: Returning "" (empty text) or 0 in IF when all matching values are negative causes MAX to return 0 instead of the true negative peak.

    Fix: Use FALSE inside legacy array MAX(IF(B2:B6="East", C2:C6, FALSE)) or use native MAXIFS, which ignores unmatched rows.

  • Mistake: Using MAXIFS in Excel 2016 or older produces #NAME? because MAXIFS launched in Excel 2019 / 365.

    Fix: For legacy compatibility, use =AGGREGATE(14, 6, C2:C6/(B2:B6="North America"), 1) without CSE.

  • Mistake: Numbers formatted as text inside C2:C6 are silently skipped by MAX and MAXIFS, returning 0.

    Fix: Clean text-formatted numbers with VALUE() or Multiply by 1 before evaluating maxima.

Engineering Pro Tips

  • Use =MAXIFS(C2:C6, B2:B6, "North America", D2:D6, "Closed Won") in Excel 365 and Google Sheets for multi-condition peaks.
  • Pair MAXIFS with XLOOKUP(MAXIFS(...), C2:C6, A2:A6) to display the winning Account name next to the peak deal size.
  • To retrieve the second-highest matching deal rather than the absolute maximum, replace MAXIFS with LARGE(FILTER(C2:C6, B2:B6="North America"), 2).

Frequently Asked Questions

Does MAXIFS work with dates?
Yes! Dates are stored as serial numbers in Excel, so MAXIFS cleanly returns the latest matching date.
What does MAXIFS return if no rows match?
MAXIFS returns 0 if no rows meet your criteria.
How do I write MAXIFS in Excel 2016 or earlier?
Use =MAX(IF(B2:B6="North America", C2:C6)) confirmed with Ctrl+Shift+Enter.

Related Formulas & Guides