The Excel DMAX Function

Related Function:
Excel Database Functions

The Excel Database Functions are designed to assist you when working with an Excel database. This typically takes the form of a large table of data, where each row in the table stores an individual record.

Each column in the spreadsheet table stores a different field (or type of information) for each record.

The database functions perform basic operations, such as count, max, min, etc, but they enable the user to specify criteria, so that the operation is performed on selected records only. Other records in the database are ignored.

Basic Description

The Excel Dmax function finds the maximum value in a field (column) in a database for selected records only. The records to be included in the calculation are defined by a set of one or more user-specified criteria.

The syntax of the function is:

DMAX( database, field, criteria )

where the arguments are listed in the table below:

database-A range of cells containing the database. The top row of the database should specify the field names.

The field (column) within the database, that you want the maximum of.

This can either be a field number, or can be the field name (i.e. the header in the top row of the database) encased in quotes (e.g. "Area", "Quarter", etc).


A range of cells that contain the criteria, to specify which records should be included in the calculation.

The range can include one or more criteria, which are presented as a field name in one cell and the condition for that field in the cell below.



You can also use the following wildcards in text-related criteria:

?    -    matches any single character
*    -    matches any sequence of characters

if you do actually want to find the ? or * character, type the ~ symbol before this character in your search.

E.g. the condition "A*e" will match all cells containing a text string beginning with "A" and ending in "e".

The criteria supplied beneath each field heading can be either:


Note that the Excel database functions are not case sensitive. So, for example, the criteria ="North" will be satisfied by cells containing the text "North" or "north".

Excel Dmax Function Examples

1QuarterAreaSales Rep.Sales

The following examples are based on the above simple database on the right, which stores the sales figures for four sales representatives, over the four quarters of a year.

Example 1

If, from the example database, we wanted to find the highest sales figure in the North area, during quarter 2, we could use the Dmax function as shown below.

In the example, the criteria are specified in cells F1 - G2 and the Dmax formula is shown in cell F3:

3=DMAX( A1:D17, "Sales", F1:G2 )

The above Dmax function calculates the maximum of the values in cells D6 & D7, and therefore returns the value $340,000.

Note that, in the above function, instead of typing in "Sales" for the field argument, we could have simply used the number 4 (to denote the 4th column of the database).

Example 2

In the example below, the Dmax function is used to find the highest quarterly sales figure for sales rep "Carol", in quarters 2, 3 or 4.

Again, the criteria are specified in cells F1 - G2 and the Dmax formula is shown in cell F3:

1Sales Rep.Quarter
3=DMAX( A1:D17, "Sales", F1:G2 )

The above Dmax function finds the maximum of the values in cells D8, D12 and D16, and so returns the value $460,000.

Further examples of the Excel Dmax function can be found on the Microsoft Office website.