Contact

Gnumeric #NUM!: Check the Mathematical Domain

Scope: Gnumeric desktop, English 1.12-series manual checked October 21, 2026. Distribution builds and translations may differ. These new exercises have not been executed in Gnumeric; results below are documentation-supported expectations and independently checked arithmetic or logic, not native test observations. Work in a disposable workbook, not your original.

A numeric input can still be invalid

Gnumeric’s error table gives SQRT(-1) as an example of #NUM!: the argument is a number, but not an acceptable one for that real-valued calculation. This is different from a text-input problem and from division by zero.

Begin by evaluating the argument separately. In =SQRT(B2-C2), inspect B2, C2 and their difference before replacing the whole expression. A correct outer function cannot make an impossible inner quantity valid.

Separate the argument from the transformation

Use an empty sheet with these entries:

Cell Entry Purpose
B2 16 First synthetic component
C2 25 Second synthetic component
D2 =B2-C2 Inspect the argument
E2 =SQRT(D2) Transform it

D2 is -9. E2 is expected to show #NUM!, not -3. A real square root cannot be negative: both 3 × 3 and -3 × -3 are positive 9, not -9.

For the controlled repair, suppose the intended expression was “second component minus first component.” Change D2 to =C2-B2. It should become 9, and E2 3. This is a repair only because the exercise specifies that direction; it is not permission to reverse any real subtraction that yields a negative number.

Change C2 to 52. D2 should become 36, E2 6. Then set C2 to 16: both D2 and E2 should be 0. Finally, set C2 to 7; D2 becomes -9 and the error should return. These boundary checks prevent a one-number cosmetic fix.

Choose a repair that preserves the model

Ask what the inner quantity represents. Is its sign meaningful? Are the two components in the same units? Was a subtraction reversed, or did a reference move to the wrong row? Trace the inputs back to their source before editing them.

Do not insert ABS automatically. Applying ABS to a negative quantity changes the mathematical question. Similarly, replacing every negative input with zero may erase evidence that a model’s assumptions failed. If your intended calculation genuinely requires complex numbers, select and document an appropriate complex-number model rather than presenting a real SQRT result as equivalent.

A #NUM! elsewhere does not prove the same cause. Read that function’s argument restrictions and isolate its inputs. This page diagnoses the domain-checking workflow, not every numerical algorithm or convergence failure.

Confirm and keep the exception visible

Document why the corrected expression is appropriate, compare an ordinary case and a boundary case, and retain an intentionally invalid case in your test notes. A generic IFERROR fallback cannot establish mathematical validity.

Use the SQRT guide for function syntax, formula diagnosis for stale or incorrect references, and the error selector for other symptoms.