DSUM Function (Gnumeric)
Use DSUM in Gnumeric to total a numeric field from records that meet visible worksheet 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 Gnumeric. How formula examples are checked
Quick answer
Use DSUM in Gnumeric to total a numeric field from records that meet visible worksheet criteria. With the data and Team 1 criteria below, =DSUM($A$1:$F$7,"Score",H1:H2) has an independently checked expected result of 70 score points.
Use DSUM when a report’s selection rules are easier to audit as a small criteria table than as a long formula. The result changes with the criteria cells while the original register can remain in its original order. The official Gnumeric 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
=DSUM(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.
Gnumeric’s manual uses comma-separated arguments in English notation. 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:
=DSUM($A$1:$F$7,"Score",H1:H2)
Expected result: 70. The selected IDs are 101, 102, 104, 106. Team 1 selects records 101, 102, 104 and 106. Their scores add to 10 + 20 + 40 + 0 = 70. Scores from Team 2 do not enter this total.
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:
=DSUM($A$1:$F$7,"Score",H5:I6)
Expected result: 50. 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:
=DSUM($A$1:$F$7,"Score",H9:I11)
Expected result: 120. 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:
=DSUM($A$1:$F$7,"Score",H14:I15)
Expected result: 90. 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
Do not add separate DSUM results for overlapping OR conditions unless you intend to count the overlap twice. A single criteria range with the alternatives on different rows selects the union of matching records; a record belongs to that union once.
A total does not describe the number or spread of the observations. Pair DSUM with DCOUNT or DAVERAGE to explain a selected group. In Team 1 a total of 70 comes from four numeric records with a mean of 17.5; another group could have the same total and a different count.
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.
Gnumeric’s function manual documents header text or an integer field selector. This guide uses explicit, populated fields; it does not claim that omitted-field conventions or numeric conversion of text match another spreadsheet. 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 Apache OpenOffice Calc DSUM 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 Gnumeric functions: DAVERAGE, DCOUNT, DPRODUCT, DGET. 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: Gnumeric 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 Gnumeric 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.