How to use the DMIN function
What is the DMIN function?
The DMIN function extracts the smallest number from a column in a database whose records match a condition or criteria.
Table of Contents
1. Introduction
How is the min number calculated?
The minimum number is simply the smallest number in a group of numbers.
What is DMIN an abbreviation of?
DMIN is an abbreviation of Database Minimum.
What is a database in this context?
Excel defines a database as a list of related data in which rows of related information are records, and columns of data are fields. The first row of the list contains labels for each column.
Where can you place the criteria range?
You can place your criteria range wherever you want on your worksheet, however, it is not recommended below the list/database. The function needs a blank row below the list to work properly.
What criteria characters are allowed?
Allowed criteria range characters are less than and greater than signs <>, use them to specify a criteria range. Also, asterisks * can be used to match partial strings.
Does the DMIN function add blank cells, boolean, and text values?
No, blank cells, boolean values and text values are ignored.
Does the DMIN function ignore error values?
No, the DMIN function does not ignore error values.
What is the difference between the DMIN function and the MIN function?
The MIN function calculates the smallest number that match a condition or criteria in a list/database whereas the MIN function calculates the smallest number without a condition/criteria.
How to include the entire database in the calculation?
To include the entire list/database enter a blank line below the criteria range column labels. In other words, don't specify any criteria.
2. Syntax
DMIN(database, field, criteria)
database | Required. The cell reference to a list or database. |
field | Required. The field argument lets you choose which column to use. You can use the column name enclosed with double quotation marks or the corresponding column number. |
criteria | Required. A cell reference to the criteria range. The criteria range needs to have column labels and at least one condition below the column label. |
3. Example 1
This example demonstrates the DMIN function using a single condition. The condition is specified above the database/list in cell range B2:C3 and contains the column header names. The DMIN function needs the column header names in order to apply the criteria to the correct column in the database/list.
The data is in cell range B6:D12 in the image above, here is that data:
Item | Size | Number |
A102 | M | 370 |
A103 | L | 690 |
A099 | S | 310 |
A412 | S | 190 |
A341 | L | 550 |
A340 | M | 730 |
The criteria are in cell range B2:C3:
Size | Number |
L |
The arguments are:
database = B6:D12
field = 3
criteria = B2:B3
Formula in cell B15:
The formula gets the minimum number from column 3 (D) with the condition that the size is L. The smallest number of 690 and 550 is 550 which is returned in cell B15.
4. Example 2
This example demonstrates AND logic between conditions.
In a sales database, you want to get the smallest sales number from column "Number" where the "Size" column is equal to "L", the "Number" values must be smaller than 650. How can you use the DMIN function to get this value?
The data is in cell range B6:D12 in the image above, here is that data:
Item | Size | Number |
A102 | M | 370 |
A103 | L | 690 |
A099 | S | 310 |
A412 | S | 190 |
A341 | L | 550 |
A340 | M | 730 |
The criteria are in cell range B2:D3:
Item | Size | Number |
L | <650 |
The arguments are:
database = B6:D12
field = 3
criteria = B2:D3
Formula in cell B15:
The formula gets the smallest number from column 3 (D) with the condition that the size is L and the condition that the number is smaller than 650. Both these criteria must match, in other words, AND logic is applied. The minimum number is 550 which is returned in cell B15.
5. Example 3
This example demonstrates the asterisk which is a wildcard character. It matches 0 (zero) to any number of characters.
In a sales database, you want to get the smallest sales number from column "Number" where the "Item" column begins with "A". How can you use the DMIN function to get this value?
The data is in cell range B6:D12 in the image above, here is that data:
Item | Size | Number |
A102 | M | 370 |
A103 | L | 690 |
A099 | S | 310 |
A412 | S | 190 |
A341 | L | 550 |
B340 | M | 730 |
The criteria are in cell range B2:D3:
Item | Size | Number |
A* |
The arguments are:
database = B6:D12
field = 3
criteria = B2:D3
Formula in cell B15:
The formula gets the smallest number from column 3 (D) with the condition that the Item begins with "A". Numbers 370, 690, 310, 190 and 550 has corresponding values in Item column that match the condition. The minimum number of these values is 190 which is returned in cell B15.
6. Example 4
This example demonstrates how to perform OR logic between conditions. You accomplish this by specifying the conditions on a row each.
In a sales database, you want to get the smallest sales number from column "Number" where the "Size" column equals "M" or "L". How can you use the DMIN function to get this value?
The data is in cell range B6:D12 in the image above, here is that data:
Item | Size | Number |
A102 | M | 370 |
A103 | L | 690 |
A099 | S | 310 |
A412 | S | 190 |
A341 | L | 550 |
A340 | M | 730 |
The criteria are in cell range B2:D3:
Item | Size | Number |
M | ||
L |
The arguments are:
database = B6:D12
field = 3
criteria = B2:D3
Formula in cell B15:
The formula gets the smallest number from column 3 (D) with the condition that the Size is "M" or "L". The values that match these two conditions are 370, 690, 550, and 730. The minimum number is 370 which is returned in cell B15.
7. Example 5
This example demonstrates how to use the question mark which is a wildcard character. The question mark matches a single character.
In a sales database, you want to get the smallest sales number from column "Number" where the "Item" column has "1" as the second character, the total character length must be 4. How can you use the DMIN function to get this value?
The data is in cell range B6:D12 in the image above, here is that data:
Item | Size | Number |
A102 | M | 370 |
A103 | L | 690 |
A099 | S | 310 |
A412 | S | 190 |
A341 | L | 550 |
A340 | M | 730 |
The criteria are in cell range B2:D3:
Item | Size | Number |
?1?? |
The arguments are:
database = B6:D12
field = 3
criteria = B2:D3
Formula in cell B15:
The formula gets the smallest number from column 3 (D) with the condition that the second character in the value from the Item column is "1". The values that match these two conditions are 370 and 690. The minimum number is 370 which is returned in cell B15.
Functions in 'Database' category
The DMIN function function is one of 11 functions in the 'Database' category.
How to comment
How to add a formula to your comment
<code>Insert your formula here.</code>
Convert less than and larger than signs
Use html character entities instead of less than and larger than signs.
< becomes < and > becomes >
How to add VBA code to your comment
[vb 1="vbnet" language=","]
Put your VBA code here.
[/vb]
How to add a picture to your comment:
Upload picture to postimage.org or imgur
Paste image link to your comment.
Contact Oscar
You can contact me through this contact form