Contact

ISFORMULA in Calligra Sheets: Detect cells containing formulas

Information Intermediate Calligra Sheets

Check formula provenance with ISFORMULA, including a calculation returning an ordinary number.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Calligra Sheets. How formula examples are checked

Quick answer: Audit whether a worksheet cell contains a formula rather than a typed value.

Release and testing scope. The KDE Calligra Sheets release listing identifies 26.08.2 (2026-10-08) as the latest release checked on 2026-10-12. This guide compares the KDE Sheets function handbook with the pinned 26.08.2 implementation. The reference handbook is older than the release. No formula was run inside Calligra Sheets for this guide. All results are labelled KDE-documented, source-inferred or independently reasoned expected; these labels are not interchangeable with observed runtime outcomes. Example formulas use KDE’s published semicolon argument separator. A localized installation may differ in input separator, function name display, date parsing and display of Boolean values.

Why ISFORMULA matters: value versus provenance

A cell may display 5 because someone typed 5, or because a formula calculated =2+3. The values are equal, but their provenance differs. ISFORMULA tests the presence of an actual formula attached to a referenced cell, so it is useful for spreadsheet audits, protected-template review, troubleshooting calculations and detecting accidental replacement of formulas by hard-coded values.

This is not a test of whether a cell’s displayed text begins with an equals sign. It also does not validate whether a stored formula is correct: a formula can return an error while still being a formula.

Syntax, argument type and return value

=ISFORMULA(x)
Position Argument Required KDE XML type Default
1 x Yes Reference to a cell None

The return type is Boolean (TRUE or FALSE). KDE’s ISFORMULA handbook entry and 26.08.2 XML entry specify one reference parameter. The implementation sets NeedsExtra(true), then reads the referenced cell’s stored formula and checks .isValid(); see C++ lines 334–344. The value returned by the referenced formula is not the deciding criterion.

Reproduce the difference in a new sheet

Enter the following original cell contents, not their resulting displayed values:

Cell What to enter Display expected
A2 =2+3 5
A3 5 5
A4 =1/0 An error indication, exact token not verified

Then enter these independent tests:

B2: =ISFORMULA(A2)
B3: =ISFORMULA(A3)
B4: =ISFORMULA(A4)
Formula Source-inferred expected result Why
=ISFORMULA(A2) TRUE A2 stores a formula even though it displays 5
=ISFORMULA(A3) FALSE A3 stores a literal number, not a formula
=ISFORMULA(A4) TRUE, pending native confirmation A4 stores a formula even though evaluation has an error

The first two outcomes follow the implementation’s stored-formula check; the third follows that design but requires native validation of error propagation and the formula engine’s reference metadata. These are expected or source-inferred values, not runtime observations. A4 was chosen to demonstrate that a formula’s correctness is a separate question from formula existence.

Advanced example: audit a calculated total column

Imagine C2:C100 should contain computed totals. In D2, add:

=IF(ISFORMULA(C2);"Formula present";"Investigate hard-coded cell")

Copy D2 through D100. If C2 = =A2*B2 and C3 = 250 typed as a number, the reasoned expected labels are Formula present and Investigate hard-coded cell. This workflow helps find possible accidental overwrites. It cannot decide whether the formula is mathematically or commercially correct, or whether a particular hard-coded value is legitimate.

Advanced case: why passing a reference matters

ISFORMULA needs the address of the original cell. Writing =ISFORMULA("A2") supplies text, not a reference. Likewise, passing =ISFORMULA(A2:A10) requests a multi-cell range for a callback that examines the first region’s top-left position. KDE does not document such range semantics, so do not assume it returns an array of Booleans. Copy a single-cell reference test down a helper column instead. Do not promise that arbitrary expressions can substitute for a reference in Calligra merely because another program accepts them.

Common errors and limitations

  • TRUE where you expected FALSE: the cell may have a formula whose result happens to be constant; inspect the formula bar, not its displayed number.
  • FALSE after a paste: a paste-values operation can replace stored formulas with numbers or text. Compare the underlying cell content.
  • "=2+3" displayed as text: a literal string beginning with = is not proof that a cell stores a formula.
  • Errors inside the referenced formula: ISFORMULA examines existence, not success. Exact error propagation in Calligra 26.08.2 has not been natively observed.
  • Invalid references, names and multi-cell inputs: KDE doesn’t publish a comprehensive runtime error matrix here. Test the target build and do not advertise an exact error code.
  • Different input separators or regional settings: the one-argument call is separator-independent, but composed IF examples use KDE’s English-handbook semicolon convention.

Excel cross-compatibility

Microsoft documents Excel ISFORMULA(reference) with the same high-level intent: TRUE if the referenced cell contains a formula. Microsoft’s examples also include formula cells that evaluate to errors. However, that confirms only Microsoft’s behavior. Calligra’s separate source callback does not establish identical handling for Excel names, ranges, invalid references or nested expressions. Port ordinary single-cell references first and verify cross-product edge cases. No native Excel or Calligra workbook test was performed here.

Official references and testing limits

Sources accessed 2026-10-12: KDE ISFORMULA, the version-pinned C++ callback, KDE function XML, and Microsoft Excel reference. No native application execution was performed.