Excel - DMAX Function



DMAX Function

The DMAX Function is categorized under Microsoft Excels Database Function. The term DMAX refers to the Database Maximum. The Microsoft Excel DMAX function will return the highest value from a field that matches the specified criteria in the database. For example, the teacher gets to know the students' highest total marks in the class 10 standard of A group only. Finding the largest value from a million of the data after setting some constraints is very time-consuming.

Compatibility

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web
  • Excel 2021
  • Excel 2021 for Mac
  • Excel 2019
  • Excel 2019 for Mac
  • Excel 2016
  • Excel 2013

Syntax

The syntax of DMAX function is as follows −

=DMAX(database,field,criteria)

Arguments

You can use the following arguments with the DMAX function −

Argument Description Required / Optional
Database A database is a collection of fields and records. You may specify the cell range representing a list of records. Required
Field It specifies the column label, enclosed in double quotes, like group. You can also use numbers 1, 2, and 3 to indicate the column placement, like 1 shows the first column, 2 shows the second column, and so on. Required
Criteria The cell range represents a specific condition. Required

Points to Remember

  • If you specify the invalid field, the DMAX function will return the #VALUE! error.
  • If you specify the incorrect database range, the DMAX function will return the #VALUE! error.
  • If the condition doesnt match with the field argument, the DMAX function will return the zero value.

Examples of DMAX Function

Practice the following examples to learn the use of the DMAX function in Excel.

Our task is to determine the maximum number of ACs sold by the Panasonic brand and the maximum number of TVs sold by the Samsung brand.

Step 1 − To become dexterous in the DMAX function, first, you may consider the sample dataset, which specifies the details of the Product, Brand, and quantity separately in the first three columns.

DMAX Function 1

Step 2 − After that, You may enter the formula =DMAX(A1:C14,C1,F2:G3) in the F9 cell and hit the Enter button

DMAX Function 2

Therefore, the DMAX function will return the result of 40, which means Panasonic has sold the maximum number of ACs.

DMAX Function 3

Step 3 − Similarly, you can calculate the maximum number of TVs sold by Samsung. In the F12 cell, write the expression =DMAX(A1:C14,C1, F5:G6) and press the Enter tab.

DMAX Function 4

DMAX Function 5

Example 2

If you specify the invalid field as a second argument in the DMAX function will return the #VALUE! error.

Solution

You must carefully specify the second argument(field) to search for the maximum integer value in the DMAX function.

Lets say you have entered an invalid field that is either empty or contains different values. In this case, the DMAX value will return the #VALUE! error.

You may enter the formula =DMAX(A1:C14,D1,F2:G3) in the F9 cell and press the Enter tab. Here, the second argument is D1(field), which contains null values.

DMAX Function 6

DMAX Function 7

Therefore, the #VALUE! error is returned by the DMAX function.

Example 3

If you specify the incorrect database range, the DMAX function will return the #VALUE! error.

Solution

You may enter the formula =DMAX(D1:E14,C1,F5:G6) in the F9 cell. Here, the first argument that specifies the database range is invalid as it contains null values.

DMAX Function 8

Therefore, the DMAX function will return the #VALUE! error. You can edit the database range to get the accurate result.

Example 3

If the condition doesnt match with the field argument, the DMAX function will return the zero value.

Solution

You can type the formula =DMAX(A1:C14,C1,F5:G6) in the F12 cell. The F6 cell refers to the incorrect brand ws, as no such brand exists in the defined database.

DMAX Function 9

Thus, the DMAX function will return a 0 value.

Furthermore, you may improve your data analysis proficiency by merging the DMAX function with aggregate functions like AVERAGE, COUNT, etc. It also incorporates seamlessly with IF statements, logical functions, and Lookup functions(VLOOKUP).

Advertisements