Information functions

TYPE

Matches all 1,582 recorded answers

Recorded: 1,227 in the answer bank and 355 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
Arabicالنوع
BulgarianTYPE
CzechTYPE (TYP)
DanishTYPE
GermanTYPE
GreekTYPE
English (Australia)TYPE
English (United Kingdom)TYPE
English (United States)TYPE
SpanishTIPO
EstonianTYPE
FinnishTYPE (Tyyppi)
FrenchTYPE (TYPE)
HebrewTYPE
CroatianVRSTA
HungarianTYPE (TÍPUS)
IndonesianTIPE
ItalianTYPE
JapaneseTYPE
KoreanTYPE(종류)
LithuanianTIPAS
LatvianTIPS
NorwegianTYPE
DutchTYPE
PolishTYPE (TYP)
Portuguese (Brazil)TIPO
Portuguese (Portugal)TYPE
RomanianTIP
RussianTYPE (ТИП)
SlovakTYP
SlovenianTYPE (VRSTA)
Serbian (Latin)TIP
SwedishTYP
Thaiชนิด
TurkishTÜR
UkrainianTYPE (ТИП)
VietnameseLOẠI
Chinese (Simplified)TYPE
Chinese (Hong Kong)TYPE (類型)
Chinese (Traditional)TYPE (類型)

Names from Microsoft's support site.

What it does

TYPE(value)

TYPE(value) returns a number naming the value's kind. Microsoft's table, verbatim:

If value isTYPE returns
Number1
Text2
Logical value4
Error value16
Array64
Compound data128

The codes are powers of two — 1, 2, 4, 16, 64, 128 — with 8 and 32 unused in the published table. That is not decoration: the numbering descends from a bit-flag encoding of admissible argument types in Excel's macro-sheet heritage, which is also why the documentation's own examples of the function's usefulness are the macro-era ARGUMENT and INPUT. Nothing in TYPE's worksheet behaviour requires you to know that, but it explains why the codes skip.

TYPE answers the same question as the IS-family classifiers, in one call instead of five, and in a form you can CHOOSE or SWITCH on. Where ISNUMBER is a boolean, TYPE is a discriminator.

Microsoft states one limit explicitly and it is the one users trip over: "You cannot use TYPE to determine whether a cell contains a formula. TYPE only determines the type of the resulting, or displayed, value. If value is a cell reference to a cell that contains a formula, TYPE returns the type of the formula's resulting value." ISFORMULA is the function for that question.

Arguments

value — required, exactly one. The published signature is TYPE(value).

The values-only resolution is also why a single-cell reference and the value inside it are indistinguishable to TYPE — see the call pipeline on the 1x1 collapse.

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 Number — one of the codes above.

  • An error input returns 16; it does not propagate. TYPE is a classifier, so an error is a subject, not a failure. TYPE(#DIV/0!) is 16, and so is TYPE(#N/A). TYPE cannot tell you which error; ERROR.TYPE can.
  • An array input returns 64 as a single scalar. This is the behaviour that distinguishes TYPE from every IS-family classifier: they lift elementwise over an array and return a mask, while TYPE looks at the argument as a whole and reports "this is an array". The reference engine implements exactly that. It makes TYPE the only cheap way to ask "did this expression produce an array?".
  • Code 128, "compound data", is in the documentation and is not reachable in the reference engine, whose declared code map has no 128 case. What produces a 128 in current Excel — if anything still does — the Handbook does not know. This is the page's clearest documented / implemented gap and is probe 1 below.
  • Codes 8 and 32 do not appear in Microsoft's table.

How to implement

Notes for implementers

  1. TYPE of an array is 64, not an array of codes. This is the axis on which TYPE diverges from the entire IS family, and routing TYPE through a shared elementwise lift helper silently breaks it. It is the single most likely implementation error on this function.
  2. Empty and Missing need an explicit mapping. Microsoft's table names neither. Whatever an engine chooses should be a recorded decision awaiting evidence, not a fall-through.
  3. Decide about 128 deliberately. An engine that cannot produce compound data has no 128 case, which is defensible — but it should be recorded as "unreachable here", not as "documented code omitted".
  4. The codes are stable numbers, not an enum's ordinal. They must be emitted as the literal published values; there is no reordering freedom.
  5. Errors are classified, not propagated. As with the IS classifiers, the error has to reach the kernel.

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.

TYPE · 1 lines · calc-func/src/catalogue/information.rs on GitHub
unary(TYPE, "TYPE", VALUE_OR_REFERENCE, type_of)
type_of · 34 lines · calc-func/src/catalogue/information.rs on GitHub
/// TYPE: 1 for a number or a blank cell, 2 for text (empty text included), 4 for a logical, 16
/// for an error and 64 for an array; Microsoft's page lists all but the blank cell. A reference to
/// one cell gives the type of the cell's value, and a reference of several areas is 16. A reference
/// to one area of several cells is 64, as an array: Excel 16.0.20527 gives 64 for the
/// dynamic-array formulas `=TYPE(A101:A103)` and `=TYPE(A101:B101)` and for the legacy
/// `=SUMPRODUCT(TYPE(A101:A103))` (dc-b1l, through COM, 2026-10-30); elsewhere a legacy formula
/// intersects it first (`=TYPE(@A101:A103)`, calc-fml). Compound data (128) is not modelled: a
/// callable is refused. #BLOCKED!
/// and #CONNECT! are refused (see [`known`]).
fn type_of(
    arguments: &[CalcValue],
    services: &mut EvalServices<'_>,
) -> Result<CalcValue, FunctionFault> {
    let site = Site::new(TYPE, services);
    let argument = &arguments[0];
    let step = match argument.core_ref() {
        // A boxed array (dc-h9u) is typed by its first element: Excel 16.0.20527 gives
        // TYPE(INDEX(GROUPBY(k,v,LAMBDA(x,x)),1,2)) 1.
        CoreRef::Array(array) if array.is_boxed() => type_code(
            &site,
            array.get(0, 0).expect("a non-empty array"),
        ),
        CoreRef::Array(_) => Ok(64.0),
        CoreRef::Reference(reference) if reference.area_count() > 1 => Ok(16.0),
        CoreRef::Reference(reference) => match one_cell(reference) {
            Some(area) => {
                referenced(&site, area, services).and_then(|value| type_code(&site, &value))
            }
            None => Ok(64.0),
        },
        _ => type_code(&site, argument),
    };
    Site::finish(step.map(CalcValue::number))
}
type_code · 11 lines · calc-func/src/catalogue/information.rs on GitHub
fn type_code(site: &Site<'_>, value: &CalcValue) -> Step<f64> {
    Ok(match known(site, value)? {
        CoreRef::Number(_) | CoreRef::Empty => 1.0,
        CoreRef::Text(_) => 2.0,
        CoreRef::Logical(_) => 4.0,
        CoreRef::Error(_) => 16.0,
        CoreRef::Missing | CoreRef::Array(_) | CoreRef::Reference(_) => {
            return Err(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

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs
20430Windows, 64-bit, CPU not recorded1,227

The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.

Recorded environments and comparison details.

Excel 16.0 build 20430

Windows, 64-bit, CPU not recorded

1,227 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.

Alternatives

Relationships

  • The IS family answers the same questions one bit at a time. The correspondence is exact where both exist: TYPE=1 matches ISNUMBER, TYPE=2 matches ISTEXT, TYPE=4 matches ISLOGICAL, TYPE=16 matches ISERROR. There is no IS function for 64, which is why TYPE(x)=64 is the standard array test.
  • ERROR.TYPE refines TYPE's 16 into a code 1–8. The two functions are complementary and are often used together: TYPE to branch, ERROR.TYPE to diagnose.
  • ISBLANK covers the distinction TYPE erases — Empty versus Number — because both report as 1.
  • ISFORMULA covers the distinction Microsoft's remark says TYPE cannot make.
  • ISREF covers the reference case TYPE never sees.
  • CELL("type", ref) is a different function with a confusingly similar name and a much coarser answer: it reports "b", "l" or "v" (blank, label, value) for a cell, is host-dependent, and is not a substitute for TYPE.
  • N and T are the projections that pair with TYPE's classification.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents