DMAX Function
Returns the maximum value in a database column for rows that meet the criteria.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| database | The range containing the database, including the header row as the first row. | Required |
| field | The column to inspect, given as the column label in quotes (e.g. "Yield") or its 1-based column index. | Required |
| criteria | The 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)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 ProfitUse the same criteria but a different field to find the top Profit.
=DMAX(A1:E7, "Profit", A9:B10)Example 2: Maximum across a single condition
Highest Yield for any apple treeCriteria A9:A10 is Tree=Apple across all three apple rows.
=DMAX(A1:E7, "Yield", A9:A10)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.
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
DMAX
dmaxPractice 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.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps