Information functions

ISFORMULA

Matches all 16 recorded answers

Recorded: 16 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicISFORMULA
BulgarianISFORMULA
CzechISFORMULA
DanishER.FORMEL
GermanISFORMULA
GreekISFORMULA
English (Australia)ISFORMULA
English (United Kingdom)ISFORMULA
English (United States)ISFORMULA
SpanishESFORMULA
EstonianISFORMULA
FinnishONKAAVA
FrenchESTFORMULE
HebrewISFORMULA
CroatianISFORMULA
HungarianKÉPLET
IndonesianISFORMULA
ItalianISFORMULA
JapaneseISFORMULA
KoreanISFORMULA
LithuanianISFORMULA
LatvianISFORMULA
NorwegianISFORMULA
DutchISFORMULE
PolishCZY.FORMUŁA
Portuguese (Brazil)ISFORMULA
Portuguese (Portugal)É.FORMULA
RomanianISFORMULA
RussianЕФОРМУЛА
SlovakISFORMULA
SlovenianISFORMULA
Serbian (Latin)ISFORMULA
SwedishÄRFORMEL
ThaiISFORMULA
TurkishEFORMÜLSE
UkrainianISFORMULA
VietnameseISFORMULA
Chinese (Simplified)ISFORMULA
Chinese (Hong Kong)ISFORMULA
Chinese (Traditional)ISFORMULA

Names from Microsoft's support site.

What it does

ISFORMULA(reference)

ISFORMULA(reference) returns TRUE if the referenced cell contains a formula, and FALSE if it does not.

Microsoft's description, verbatim: "Checks whether there is a reference to a cell that contains a formula, and returns TRUE or FALSE."

The important word is contains. ISFORMULA asks about the cell's content — is there a formula stored there — not about the cell's value. A cell holding =1+1 and a cell holding the literal 2 display the same thing, produce the same value everywhere downstream, and are distinguished by exactly one worksheet function: this one.

Microsoft's TYPE page states the complementary limitation from the other side: "You cannot use TYPE to determine whether a cell contains a formula." ISFORMULA, added in Excel 2013, is the function that filled that hole.

Arguments

reference — required, exactly one. The published signature is ISFORMULA(reference).

Microsoft's argument description, verbatim: "Reference is a reference to the cell you want to test. Reference can be a cell reference, a formula, or a name that refers to a cell."

Two things that sentence settles, and one it does not:

  • A defined name is admissible provided it resolves to a reference. A name that refers to a constant or to a formula expression is not a reference and is an error — see "Errors".
  • "A formula" in that list means an expression that produces a reference, such as INDIRECT("A1") or OFFSET(A1,0,0). ISFORMULA(INDIRECT("A1")) asks whether A1 holds a formula, not whether INDIRECT(...) is one.
  • What it does not settle is the multi-cell case. ISFORMULA(A1:A10) is not addressed by the documentation, and whether it spills a column of booleans on a modern build or intersects to a single answer is not established here.

The argument is a reference position, not a value position. Handing ISFORMULA a computed value is a failure, not a coercion, and that is exactly what the documented #VALUE! condition covers.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

Quirks

Result and edge cases

Returns a Logical.

  • A cell containing a constant is FALSE — including a constant that was typed as the result of a formula and then pasted as values, which is the workflow this function exists to audit.
  • An empty cell is FALSE. It contains no formula.
  • A cell whose formula evaluates to an error is still TRUE. The formula is there; its result is irrelevant. This is the property that makes ISFORMULA useful for auditing a broken sheet — ISERROR finds the symptom, ISFORMULA finds whether there is anything to fix.
  • A cell whose formula returns the empty string is TRUE, while ISBLANK on it is FALSE and it looks empty. The three-way disagreement between what the eye sees, what ISBLANK says and what ISFORMULA says is the standard way to find ="" helper columns.
  • A spilled cell. The anchor of a dynamic array holds the formula; the spilled-into cells do not hold formulas of their own. What ISFORMULA reports for a spilled-into cell is not established here, and it is the single most interesting open question about this function on a modern build.
  • Volatility. The function is declared NonVolatile, unlike CELL and INFO — editing a cell's content is a change Excel's dependency graph tracks, so ISFORMULA does not need to recalculate on a timer the way a formatting query does.

Errors

  • #VALUE! — documented, verbatim: "If reference is not a valid data type, such as a defined name that is not a reference, ISFORMULA returns the #VALUE! error value." This covers a literal, a computed value, and a defined name that resolves to a constant or an expression.
  • #NAME? would arise before ISFORMULA runs, from an unresolvable name, in reference resolution (coercion and lifting).
  • #REF! likewise, from a reference whose target has been deleted.
  • Arity — zero arguments or two. Expected to be refused at formula entry rather than evaluated (the call pipeline).

Note that ISFORMULA is one of the few IS-named functions with a documented error return. The classifiers have none; ISFORMULA has one because its argument can genuinely be of the wrong kind.

How to implement

Notes for implementers

  1. ISFORMULA cannot be answered from values. It requires a workbook that stores cell content distinctly from cell value. An engine whose model is "cells hold values" cannot implement it, and should refuse rather than guess.
  2. The reference must survive preparation unresolved. Dereferencing loses the subject entirely: the value at the cell says nothing about whether a formula produced it.
  3. The documented #VALUE! is a real, reachable path, not a fallback. It fires for a defined name that is not a reference, which is a case an implementation must distinguish from an unresolvable name (#NAME?).
  4. Decide the multi-cell and spill cases deliberately and record them as decisions awaiting evidence; the documentation covers neither.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

ISFORMULA · 1 lines · calc-func/src/catalogue/information.rs on GitHub
unary(ISFORMULA, "ISFORMULA", REFERENCE, isformula)
isformula · 26 lines · calc-func/src/catalogue/information.rs on GitHub
/// ISFORMULA: whether the reference's first cell holds a formula, as the host says; see the
/// module documentation. The call interface refuses any other argument at admission, as Excel refuses
/// such a formula at entry.
fn isformula(
    arguments: &[CalcValue],
    services: &mut EvalServices<'_>,
) -> Result<CalcValue, FunctionFault> {
    let site = Site::new(ISFORMULA, services);
    let cell = match arguments[0].core_ref() {
        CoreRef::Reference(reference) => reference.areas()[0].first(),
        _ => return Site::finish(Err(site.not_modelled(Some(0)))),
    };
    // dc-ylr: Excel gives ISFORMULA of a reference to a closed workbook #N/A.
    if services
        .host()
        .is_some_and(|host| host.is_external_sheet(cell.sheet()))
    {
        return Site::finish(Ok(CalcValue::error(WorksheetErrorCode::NA)));
    }
    let known = services.host().and_then(|host| host.is_formula(cell));
    Site::finish(
        known
            .map(CalcValue::logical)
            .ok_or_else(|| site.not_modelled(Some(0))),
    )
}

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.

Alternatives

Relationships

  • FORMULATEXT(reference) returns the formula's text where ISFORMULA returns a boolean. They arrived together in Excel 2013 and are usually used together: IF(ISFORMULA(A1), FORMULATEXT(A1), A1) renders a sheet's formulas alongside its constants. FORMULATEXT returns #N/A where ISFORMULA returns FALSE, which is why the guard is worth writing.
  • TYPE explicitly cannot answer this question; Microsoft says so on its own page.
  • CELL("contents", ref) returns the value, "not a formula" in Microsoft's own words — the same limitation stated a third time.
  • ISREF tests whether an expression is a reference; ISFORMULA tests what is stored at one. Both are reference-aware and they are easy to confuse.
  • ISBLANK is the companion in the ="" diagnosis described above.
  • SHEET, SHEETS, CELL, INFO are the other host-backed members of the Information category.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents