Adding the OR branches
A record may satisfy both criteria rows. The selected database record contributes once, not once per branch.
Step-by-step guide · read-only ·
Loading your interactive spreadsheet…
Preparing the worksheet and formulas…
Enter a formula in N5 that returns the field selected by H6 from A1:E13 when exactly one record matches H1:K3. Use AND within a criteria row and OR between rows; a record matching both rows is still one match. Return genuine #VALUE! for no matching record and genuine #NUM! for multiple matches. Do not return the first match, hide cardinality errors, or turn an identical literal text value into an error. A unique numeric zero or Boolean FALSE remains a valid result.
All nonblank conditions on one row use AND; the two rows use OR. A blank row matches every record. These controls store literal text, so =East stays a criterion rather than becoming an executable formula.
| Criteria row | Region | Status | Units rule 1 | Units rule 2 |
|---|---|---|---|---|
| 2 | =West | =Released | >=3 | <=3 |
| 3 | =West | =Released | >=3 | <=3 |
Applied field:
Follow the highlighted cells. Switch to Your turn to edit. Answer cell: N5. Browser calculations may differ from your Excel version.
Practice stays on this device. No worksheet data is uploaded.
Separate zero, one and multiple matching records while preserving the selected field type.
Enter a formula in N5 that returns the field selected by H6 from A1:E13 when exactly one record matches H1:K3. Use AND within a criteria row and OR between rows; a record matching both rows is still one match. Return genuine #VALUE! for no matching record and genuine #NUM! for multiple matches. Do not return the first match, hide cardinality errors, or turn an identical literal text value into an error. A unique numeric zero or Boolean FALSE remains a valid result.
=DGET($A$1:$E$13,$H$6,$H$1:$K$3)The formula uses the interactive worksheet above. Adjust ranges and criteria for your own data.
Region and Status criteria use text prefixes, wildcard patterns or explicit =exact text. Comparisons are case-insensitive; * matches multiple characters, ? matches one, and ~ escapes a wildcard or tilde. A leading apostrophe is an Excel entry aid for storing a criterion beginning with = as literal text; it is not part of the stored criterion.
A criteria rule selects records first. Numeric summary functions then ignore nonnumeric values in the selected field. A matching record containing text "18" or TRUE is different from a numeric observation, and a unique literal "#NUM!" is different from the actual multiple-match error.
Units inputs are whole numbers within ±10,000. Amount accepts numeric cents within ±1,000,000, literal text, Boolean values or blanks. Numeric comparisons in this course apply only to Units. Text ordering/not-equal criteria, calculated criteria columns, external databases and typed source errors require separate rules.
The first row supplies field names. The database range includes all twelve original records, not only the visible matches.
Across H:K, all nonblank conditions on a row must hold. Across rows 2 and 3, either complete rule can select a record. Matching both rows does not create a second observation.
The repeated Units headings apply a lower and an upper bound to one record. A completely blank criteria row matches all records.
H6 is the field header Amount or Units. Keep it as a worksheet reference so the same formulas work when the selected field changes.
Count matching records before returning a value: zero matches is #VALUE!, multiple matches is #NUM!, exactly one returns its actual value.
A record may satisfy both criteria rows. The selected database record contributes once, not once per branch.
All columns on a row combine with AND. Different rows are alternatives.
DGET is an exactly-one-record operation. Returning a first match conceals ambiguity.
Original criteria records and independent selection/type/cardinality rules checked against the real browser formula engine. Native Excel and Sheets recalculation/edit/save remain separate verification steps.
Content version 1. Practice checks compare calculated results across different datasets; they do not certify every possible formula.