Contact

TYPE Function (Gnumeric)

Information Beginner Gnumeric

Learn the TYPE function in Gnumeric: Returns the data type of a value (1 = number, 2 = text, 4 = Boolean value, 16 = error value, 64 = array).

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

Validation limits: Expected outcomes were reasoned from the official manual and checksum-verified Gnumeric 1.12.62 source. No native Gnumeric execution or screenshots were performed.

Purpose and a crucial clarification

Use TYPE to ask which kind of value a formula or cell returns. In the official Gnumeric Information reference, a number produces 1, text 2, a Boolean 4, an error 16 and an array 64 [R1]. This is useful for spreadsheet imports that unexpectedly mix numeric part numbers and textual identifiers, or for formulas returning an error rather than the intended value.

Formula versus result: Gnumeric TYPE has no formula code 8. A cell containing =2+3 returns a number, so TYPE reports 1. Use ISFORMULA to detect the presence of a formula independently of its result. [R1, R2]

Official syntax, version and argument details

=TYPE(value)
Argument Position Required? Meaning
value First (only) Yes An expression, scalar value or reference whose evaluated data type is reported.

No optional arguments or defaults are documented [R1]. Names and code values here are from Gnumeric, not borrowed from a different spreadsheet product. Formulas follow the English 1.12 reference and use comma separators where necessary; localized installations may use different notation, so verify locally. Latest Gnumeric 1.12-series release found at this review is 1.12.62 (September 21, 2026) [R3]. The inspected source matches the official 1.12.62 release archive; source inspection cannot substitute for testing the distributed executable [R2].

Gnumeric’s documented return codes

Result Gnumeric type Example expression
1 Number TYPE(3)
2 Text TYPE("Gnumeric")
4 Boolean TYPE(TRUE())
16 Error value TYPE(NA())
64 Array Array-valued input (release-specific formula testing pending).

These are the documented code families [R1]. The separately reviewed C implementation also maps empty values to numeric code 1, a nuanced source-level detail not listed explicitly in the brief manual; blank-reference behavior needs native testing [R2]. Do not add a formula code of 8 for Gnumeric.

Reproducible examples and expected results

Paste each formula into a blank cell. The results are independent expectations, not direct test observations.

Formula Expected result Explanation
=TYPE(3) 1 A number [R1].
=TYPE("Gnumeric") 2 A text string [R1].
=TYPE(TRUE()) 4 Boolean true, which is not ordinary numeric data [R1].
=TYPE(NA()) 16 Evaluated error value [R1, R2].
=TYPE(2+3) 1 The evaluated result is the number 5 [R1, R2].
=TYPE(1/0) 16 The evaluated result is an error rather than a number [R1, R2].
=TYPE("123") 2 Quoted digits are text, not a numeric value [R1].

Note that source implementation tests the value’s internal type. Input coercion, dynamic arrays and blank-cell handling are areas for version-specific native tests, not conclusions drawn from another spreadsheet [R2].

Worksheet exercise: imported identifiers

Build this miniature import table, entering text identifiers exactly as specified:

Cell Value or formula Expected interpretation
A1 Input Heading
B1 TYPE code Heading
A2 1024 Number entered directly
A3 ="1024" Formula returning text
A4 =2+3 Formula returning 5
A5 =NA() Error
B2 =TYPE(A2) 1
B3 =TYPE(A3) 2
B4 =TYPE(A4) 1
B5 =TYPE(A5) 16

This distinguishes digits stored as text from numerical values. For SKU/part identifiers with leading zeros, treating all items as text may be important. A TYPE result of 1 says nothing about whether leading zeros were originally present or whether a formula produced the value.

Advanced checks and validation

To label numbers versus text while preserving unexpected cases, use:

=IF(TYPE(A2)=1,"Numeric",IF(TYPE(A2)=2,"Text","Other"))

Expected: for A2=1024 the formula produces Numeric; for A2=="1024" it produces Text; Boolean and errors require distinct handling. Important: TYPE(A2) may return code 16 for an error value, but this validation formula has not been executed natively against error-bearing references. For a simpler direct number check consider ISNUMBER; for a formula-presence check use ISFORMULA [R1].

Troubleshooting and limitations

  • Why is a formula not code 8? Code 8 is absent from Gnumeric’s documented TYPE table and inspected source switch. TYPE classifies the result, not the presence of the formula [R1, R2].
  • Why does "123" return 2? It is quoted text. A number that happens to be displayed as digits is not identical to text containing digits [R1].
  • Why is an error code 16, not 7? TYPE answers “is this an error-type value?”; ERROR.TYPE answers “which error class?” and maps the actual #N/A error to 7 [R1].
  • Why 64? The manual assigns code 64 to arrays. Array-formula entry and version-dependent array evaluation were not tested; verify with an actual array example in the target Gnumeric environment [R1].
  • Why do blank cells or range arguments behave unexpectedly? Empty and range values have implementation-specific handling (the inspected release source groups empties with numbers and cell-range values with errors). Treat such edge cases as requiring native testing rather than promising behavior in every 1.12.62 installation [R2].
  • Locale mismatch? Consult the Gnumeric installation’s syntax for function names and delimiters; the English reference uses the notation above [R1].

Gnumeric’s manual labels TYPE as Excel-compatible for its standard values [R1], but do not assume all features or metadata of newer Excel data types work identically. Code 8 is not a Gnumeric TYPE result according to the inspected manual/source. Related guides: ERROR.TYPE, ISNUMBER, ISTEXT, ISLOGICAL, ISFORMULA, IF.

Official sources and validation detail

Validation: Official manual and release-source review plus independent logical checks of the displayed examples. Native Gnumeric execution, screenshots, locale regression and workbook round-trip tests were not performed.