Contact

DGET in ONLYOFFICE: Retrieve One Matching Numeric Value

Database Intermediate ONLYOFFICE

Retrieve a unique matching database value, distinguish missing and duplicate matches, and understand numeric-output limitations in the checked source.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: =DGET(A1:D8,"Amount",O1:O2) has the independent target 20 because the ID 103 criterion identifies one record. DGET checks the retained selected values, rather than choosing the first match. With blank selected fields it cannot by itself certify that exactly one database record matched.

Syntax and field selection

=DGET(database, field, criteria)

All three arguments are explicit in this guide. Database includes its header row; field is a quoted header or one-based column position within that database; criteria is a separate rectangle with recognized headers and at least one row beneath them. The official DGET reference documents this interface.

Build the database and criteria blocks

Create a blank sheet named DatabaseChecks. Enter this database in A1:D8, including the header row. Entries marked empty must be genuinely empty cells, not the word “empty”, a space or a formula returning empty text.

Row A: ID B: Team C: Amount D: Note
2 101 East 10 ready
3 102 West 40 ready
4 103 East 20 empty
5 104 East 30 hold
6 105 North 0 ready
7 106 East -5 review
8 107 East 15 empty

These are fictional records. Amount is deliberately numeric, including a genuine zero and a negative adjustment. Note provides a separate text/blank field for count comparisons. Headers are unique and consistent.

Build these separate criteria blocks; none overlaps A1:D8:

Purpose Exact entries Range
East only Q1 Team; Q2 East Q1:Q2
East AND amount at least 20 F1 Team; G1 Amount; F2 East; G2 >=20 F1:G2
East OR West I1 Team; I2 East; I3 West I1:I3
No matching team K1 Team; K2 South K1:K2
All records M1 Team; M2 genuinely empty M1:M2
Unique ID 103 O1 ID; O2 numeric 103 O1:O2
Unique ID 105 S1 ID; S2 numeric 105 S1:S2

Enter >=20 as criterion text, not a formula. Place result formulas in U2:U15, outside every data/criteria block. The extra spaces used in this explanation are not part of the header text.

Worked unique retrievals

Formula Independent or source target Interpretation
=DGET(A1:D8,"Amount",O1:O2) 20 Unique ID 103
=DGET(A1:D8,3,O1:O2) 20 Same field by position
=DGET(A1:D8,"Amount",S1:S2) 0 Unique ID 105 has a real zero
=DGET(A1:D8,"Amount",Q1:Q2) #NUM! Multiple East values
=DGET(A1:D8,"Amount",K1:K2) #VALUE! No South match

The numeric targets follow directly from the table; error targets are predictions from the inspected source. Do not interpret the valid zero for ID 105 as a missing-match signal. Conversely, do not assume that multiple matching rows will be reduced to the first or last value.

Advanced: validate uniqueness separately

Before relying on a retrieval, inspect =DCOUNTA(A1:D8,"ID",O1:O2), with target 1. For the East criteria the same ID count is 5, so the request is ambiguous. A visible uniqueness count makes the issue clearer than wrapping every DGET error in a generic fallback string.

For a two-column identifier test, create F4 Team and G4 ID, with F5 East and G5 numeric 103. =DGET(A1:D8,"Amount",F4:G5) has target 20 because both conditions apply on one criteria row. This extra block is outside A1:D8 and the existing F1:G2 block. If you put the conditions on separate rows instead, they become OR alternatives and may admit additional records.

Do not deduplicate matching records only because their Amount values happen to be equal. DGET’s intended question is whether the selection is unique, not whether the selected values look alike. The checked helper also skips genuinely empty selected fields, so a populated numeric ID is a safer separate uniqueness check than the output field itself.

Numeric-output restriction and errors

The official purpose describes extracting a value, but this tagged implementation constructs a numeric result from the selected raw value. This guide therefore demonstrates numeric Amount retrieval only. It does not promise faithful text retrieval from Note or cross-application equivalence for mixed types. Use a separately verified lookup workflow when the required output is text.

A matching record with an empty selected Note takes the helper’s empty-result path: =DGET(A1:D8,"Note",O1:O2) is source-predicted #DIV/0!, distinct from no matching South record’s #VALUE!. An unknown selected field with matching criteria is also source-predicted #VALUE!, so the error alone does not identify the cause.

Changing an OR row order can encounter the shared-helper early-return caveat below. An accidental all-record blank criterion will normally make this fixture’s numeric DGET ambiguous. Keep criteria explicit and inspect the matching ID set before treating an error as bad data.

Criteria logic and important ONLYOFFICE source limits

Conditions in one criteria row are combined with AND; separate rows supply OR alternatives. The first main OR row above matches East, and the second matches West. A record matching both alternatives is collected once in the inspected helper.

A blank criterion means no restriction for that column in the checked source. Thus M1:M2 selects all records; it is not a request to find blank Team cells. An accidental blank OR row can similarly broaden the selection. Keep the criteria rectangle tight rather than including unused rows for convenience.

Bare text is another trap: the helper appends a wildcard to a text criterion without an operator. East can therefore match a longer prefix such as Eastside. This database contains no such team, so the main results are unambiguous. To request explicit equality in a future test, store =East as text, for example by typing a leading apostrophe before it; do not accidentally enter it as a formula. Wildcard, case and locale edge behavior needs its own bounded validation.

There is also a version-specific OR caveat. The inspected helper can return early when the first recognized criteria row has no matches, before considering later OR rows. Do not promise order-independent OR behavior from this implementation. Reversing a deliberately unmatched first row and a matching second row is a separate source-predicted regression probe, not a native test performed here.

Unknown criterion headers are not a safe way to request “no match”: the helper skips unrecognized headers and, if none are recognized, can select every record. Copy valid headers exactly and distinguish a misspelled criterion heading from an unknown selected field. These observations come from the shared source helper, not from applying another product’s database-function rules.

DAVERAGE, DCOUNT, DCOUNTA, DMAX, DMIN and DSUM use related database/criteria structures but answer different questions. Choose the operation that matches the question; shared argument structure does not make their outputs interchangeable.

Availability, compatibility and verification

The function is currently documented in ONLYOFFICE’s unversioned Spreadsheet Editor help. Its first introduction release/date, final supported version and any retirement announcement are not established by these sources. Documentation presence does not establish support in every older Desktop Editors build, Docs deployment or mobile client.

This guide checks official SDKJS tag v10.0.0.169, commit 3679e0375a758d7dc59d31337a45461be3525ed8, alongside current help on October 18, 2026. Main arithmetic is independently calculated; implementation-specific branches are labeled source-predicted. No ONLYOFFICE engine or application was executed for these examples. No native screenshots or recalculated workbook are claimed.

Formulas use English names and comma separators. Adapt separators to the actual editor locale. Similar function names elsewhere do not guarantee identical criteria matching, text coercion, errors or blank-field handling. Keep the database header in the formula range and preserve genuinely empty cells when transferring the example.

References checked October 18, 2026