DMAX Function (OpenOffice Calc)
Use DMAX in Apache OpenOffice Calc to find the largest numeric value among records meeting your criteria. Includes criteria examples, expected results and compatibility notes.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in OpenOffice Calc. How formula examples are checked
Quick answer
Use DMAX in Apache OpenOffice Calc to find the largest numeric value among records meeting your criteria. With the data and Team 1 criteria below, =DMAX($A$1:$F$7;"Score";H1:H2) has an independently checked expected result of 40 score points.
Use DMAX to find a highest score or upper measured value within a selected group. Its criteria range makes the group definition inspectable without sorting or rearranging the underlying records. The official Apache OpenOffice Calc reference documents this database function. Here, “database” means a rectangular worksheet range with a header row; it does not require a database server.
Exact syntax and parameters
=DMAX(database;field;criteria)
Database: include the headers as well as the data, for example $A$1:$F$7. One row represents one record. Do not start at row 2 and accidentally treat the first record as the header.
Field: identify the column to calculate, such as "Score". A column number is counted from the left edge of the database, starting at 1; it is not a worksheet column letter. The field being calculated can differ from the field used to filter records.
Criteria: supply a separate cell range containing matching column headings and the conditions below them. Conditions on the same row mean AND; separate condition rows mean OR. A record satisfying more than one alternative is still one selected record. The examples always provide all three arguments and do not depend on omitted-field behaviour.
Apache’s English Calc Help uses semicolons. These examples follow that notation, not Excel’s comma-separated examples. Localized names and separators may differ; follow your installed Function Wizard or formula editor. The examples deliberately use numeric Team/Class codes to avoid assuming identical text-pattern settings between programs.
Practice data and layout
Open a blank worksheet. Enter the six headers ID, Team, Class, Score, Factor, Note in A1:F1, then enter the records below in A2:F7. F3 must be truly empty: do not type the words “leave empty.” Place criteria to the right of the database and results in column K, so no result overwrites an input.
| Row | A: ID | B: Team | C: Class | D: Score | E: Factor | F: Note |
|---|---|---|---|---|---|---|
| 2 | 101 | 1 | 1 | 10 | 2 | Ready |
| 3 | 102 | 1 | 2 | 20 | 3 | leave empty |
| 4 | 103 | 2 | 1 | 30 | 4 | Hold |
| 5 | 104 | 1 | 1 | 40 | 5 | Ready |
| 6 | 105 | 2 | 2 | 50 | 6 | Ready |
| 7 | 106 | 1 | 2 | 0 | 1 | Hold |
Download the input CSV. This CSV contains the six-column input table only, not formulas or prefilled criteria. Import at A1 and keep the empty Note field empty. The same fixture is used in the companion program guide to make cross-software comparisons reproducible.
Worked examples: one condition, AND and OR
Example 1 — select Team 1
Put Team in H1 and the number 1 in H2. In K2 enter:
=DMAX($A$1:$F$7;"Score";H1:H2)
Expected result: 40. The selected IDs are 101, 102, 104, 106. The Team 1 scores are 10, 20, 40 and 0, so the largest is 40. The result is the score itself. It is not the ID 104, the worksheet row number, or a complete winning record.
Example 2 — Team 1 AND Class 1
Enter H5=Team, I5=Class, H6=1, I6=1. Both tests are in the same criteria row, so a record must pass both. Enter in K6:
=DMAX($A$1:$F$7;"Score";H5:I6)
Expected result: 40. Only IDs 101 and 104 match. Compare those two source records with the result, rather than counting every Team 1 record or every Class 1 record independently.
Example 3 — Team 2 OR Score at least 40
Enter H9=Team, I9=Score, H10=2, leave I10 and H11 empty, and type >=40 in I11. These are two alternative criteria rows. In K10 enter:
=DMAX($A$1:$F$7;"Score";H9:I11)
Expected result: 50. The selected IDs are 103, 104 and 105. Record 105 meets both alternatives but is included only once. This is why adding two separate aggregates can give a different answer when their conditions overlap.
Advanced example — two bounds on the same field
Use the header Score twice, in H14 and I14. Type >=20 in H15 and <=40 in I15. Repeated headings let you express a lower and upper bound on one field within the same AND row. In K15 enter:
=DMAX($A$1:$F$7;"Score";H14:I15)
Expected result: 40. The selected IDs are 102, 103 and 104. The bounds are inclusive. Putting the two bounds on different rows would express OR and would select a different set of records.
Interpret the result correctly
A maximum does not tell you which record produced it, and several records can tie. A follow-up lookup by that score alone may be ambiguous. Include a unique ID or define a tie-breaking rule before returning related fields.
To measure the spread from smallest to largest for Team 1, subtract DMIN from DMAX using identical criteria: 40 - 0 = 40 points. This range uses only two extremes and is not a substitute for standard deviation, which uses all numeric observations.
Troubleshooting and scope
If a result looks wrong, check the selected record IDs before changing the arithmetic. A heading typed differently from the database header, a criteria range lacking its header, or a condition placed on the wrong row changes the selection. Keep criteria ranges tight: accidentally including an entirely empty alternatives row can undermine the intended restriction.
Inspect numeric inputs as numbers, not imported text with currency symbols or hidden spaces. These examples use valid numbers and one genuinely empty Note cell. They do not establish how every blank, formula-generated empty string, boolean, error cell or numeric-looking text is coerced in every release.
Apache Calc’s help explicitly notes that calculation settings affect identical-entry searches and includes regular-expression guidance. Do not copy Excel wildcard assumptions into a text-criteria worksheet without checking those settings. For DCOUNT, Apache documents a nonempty field parameter; the examples use a header rather than its special field-zero option. For large or changing data, expand the database range deliberately to include new rows. Absolute references such as $A$1:$F$7 prevent copying from shifting the range, but they do not make the range grow automatically.
Compatibility and related functions
The Gnumeric DMAX guide uses the same input data and record-selection examples. The two official references document the same broad purpose and three-part database/field/criteria structure. That is not proof of identical error tokens, text matching, numeric coercion or file-format round trips. Start with these ordinary numeric cases, then test your actual workbook in each destination program.
Related Apache OpenOffice Calc functions: DMIN, DGET, DCOUNT, DSTDEV. Choose a different aggregate when the question changes rather than interpreting every numeric output as a total or a count.
How this guide was checked
Official references reviewed on 2026-10-12: Apache OpenOffice Calc database-function documentation and the companion program’s documentation. Argument order, header-based selection and the function’s purpose were checked against those references. The worked dataset, selected IDs and arithmetic are original examples, independently evaluated with a small Python model.
No native application run: these are expected results, not outputs observed in an installed Apache OpenOffice Calc application. No claim is made about the earliest release supporting the function or every platform. The documentation checked is English desktop-function documentation, not a mobile compatibility guarantee. Example-check record · Editorial standards.