Quick Answer

DMAX Function

Returns the maximum value in a database column for rows that meet the criteria.

✓ Excel✓ Google SheetsExcel All versions

Syntax

DMAX
(database, field, criteria)

Parameters

ParameterDescriptionRequired
databaseThe range containing the database, including the header row as the first row.Required
fieldThe column to inspect, given as the column label in quotes (e.g. "Yield") or its 1-based column index.Required
criteriaThe range with a header row matching database column names and one or more condition rows; only matching records are considered.Required

Basic Example

Find the highest Yield among apple trees taller than 10

=DMAX(A1:E7, "Yield", A9:B10)
Result14

The criteria A9:B10 (Tree=Apple, Height>10) matches two rows with Yield 14 and 10; the largest is 14.

Advanced Examples

Example 1: Maximum Profit among matching trees

Switch the field to Profit

Use the same criteria but a different field to find the top Profit.

=DMAX(A1:E7, "Profit", A9:B10)
Result: 105
The two matching rows have Profit 105 and 75, so the maximum is 105.

Example 2: Maximum across a single condition

Highest Yield for any apple tree

Criteria A9:A10 is Tree=Apple across all three apple rows.

=DMAX(A1:E7, "Yield", A9:A10)
Result: 14
Apple yields are 14, 10, and 6; the maximum is 14.

How DMAX Works

DMAX filters the database to rows matching the criteria, then returns the greatest numeric value found in the specified field column of those rows. If no records match, DMAX returns 0.

1
Set up the database
Enter your table with a header row, e.g. A1:E7 with Tree, Height, Age, Yield, Profit.
2
Set up criteria
Place criteria headers and values in a separate range, e.g. A9:B10.
3
Enter DMAX
Type =DMAX(A1:E7, "Yield", A9:B10) and press Enter.

Important Notes & Limitations

  • Considers only numeric values in the field; text is ignored.

  • If no records match, DMAX returns 0 rather than an error.

  • Criteria header labels must exactly match database headers.

Common Errors & Fixes

0 resultNo rows matched the criteria, so there is no value to maximize.

Fix: Check that the criteria headers and conditions match the database.

#VALUE!The field was an unquoted column name.

Fix: Wrap the field name in quotes, e.g. "Yield", or use the column index.

Download Practice File

Practice DMAX with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the DMAX function. Works in both Excel and Google Sheets.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

What does DMAX return if nothing matches?
It returns 0, not an error.
Does DMAX ignore text in the field?
Yes. Only numeric values in matching rows are considered for the maximum.
How is DMAX different from MAXIFS?
DMAX filters a multi-column database by a full criteria range, while MAXIFS applies multiple single-range conditions.