ONLYOFFICE TYPE Function: Identify Number, Text, Boolean, Error and Array Values
Understand ONLYOFFICE TYPE return codes 1, 2, 4, 16 and 64 with a reproducible data-audit worksheet and edition-specific cautions.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Purpose: Return a numeric code describing the evaluated value type rather than the cell’s visible formatting or whether it contains a formula.
Availability and version history
- Introduced: The original introduction version and date are not established by the official sources checked.
- Availability: Documented in the current ONLYOFFICE Spreadsheet Editor help; no final working-version endpoint is established.
- Scope: Docs and Desktop Editors release separately. This unversioned help does not establish availability in every older build, mobile client or deployment.
- Checked: October 14, 2026, against the official function reference. Documentation check; not a new native test.
Quick answer and return-code table
=TYPE(A2) returns a number indicating what kind of result A2 contains. The ONLYOFFICE TYPE function reference lists these codes:
| TYPE output | Kind of value | Simple example |
|---|---|---|
1 |
Number | 27 |
2 |
Text | "27" |
4 |
Logical/Boolean | TRUE |
16 |
Error | #N/A or #DIV/0! |
64 |
Array | Array-valued argument; precise range/array behaviour requires native testing |
These are type codes, not error codes. A return of 16 does not identify which error occurred, and a return of 1 does not mean the number equals 1. For example, the numeric value 827 yields type 1.
Syntax and argument requirements
=TYPE(value)
| Parameter | Required | Meaning | Default |
|---|---|---|---|
value |
Yes | The value, reference or expression whose evaluated kind should be reported. | None documented |
The outer TYPE function needs just one argument and no delimiter. Nested functions such as IF use separators shown as commas in ONLYOFFICE’s English help. Localized versions may use different separators or names. The checked vendor page does not state exactly how every array-formula form or modern dynamic data type behaves; do not assume a spreadsheet-app-specific result without testing.
Reproducible worksheet: values that look alike
In a blank sheet, prepare the inputs in column A. Format A3 as Text before entering 0084. Enter each =... expression as a formula; do not paste the literal equal sign as plain text. In B2 enter =TYPE(A2) and fill through B9.
| Row | Enter into A | Expected value shown in A | Expected B: TYPE(A) | Explanation |
|---|---|---|---|---|
| 2 | 84 |
84 |
1 |
Numeric constant. |
| 3 | 0084 |
0084 |
2 |
Text ID, despite digit characters. |
| 4 | =TRUE() |
TRUE |
4 |
Formula returns a Boolean. |
| 5 | =NA() |
#N/A |
16 |
Formula returns an error. |
| 6 | ="Complete" |
Complete |
2 |
Formula returns text. |
| 7 | =1+1 |
2 |
1 |
Formula returns a number. |
| 8 | =1/0 |
#DIV/0! |
16 |
Formula returns an error. |
| 9 | ="" |
Visually empty string | 2 (expected; native check pending) |
Formula returns empty text, not a physically empty cell. |
The ordinary number, text, logical and error results follow the vendor’s return-code table and independent classification; the empty-string case is additionally corroborated by the pinned source below and still lacks native confirmation. Results are expected, not observed in a running ONLYOFFICE application.
Advanced use: prevent accidental arithmetic on text IDs
A warehouse export may store quantities as numeric-looking text. TYPE can help decide whether the input is actually numeric before arithmetic:
=IF(TYPE(A2)=1,A2*2,"Check data type")
With A2 = 84, expect 168. With A3 = text 0084, copying the formula to row 3 should return Check data type. The goal is not automatically to convert the ID; it is to detect a type mismatch before calculating.
To label errors without flattening other types:
=IF(TYPE(A5)=16,"Source contains error","No error value")
A5 contains =NA() in the worksheet, so the expected label is Source contains error. If this is used on A7, which evaluates to 2, it should return No error value. In this pattern TYPE classifies the evaluated result. To ask whether a cell contains an actual formula, use ISFORMULA(reference) instead.
Why number formatting is not enough
Formatting the display of a numeric cell as currency, a percentage or date does not make its underlying evaluated number into text. Conversely, an identifier like 0084 is still text even though it consists of digit characters. TYPE helps diagnose the storage/evaluation kind; it does not determine whether the input is semantically valid. Never interpret TYPE(A2)=1 alone as permission to sum all values in a data set.
Array code and version-specific limits
ONLYOFFICE’s reference documents 64 for an array-valued input but does not give an edition-specific matrix describing which array constants, dynamic arrays, range references or imported spill formulas are interpreted as arrays by TYPE. This guide therefore records 64 in the official code table, but does not supply an untested executable array-constant example as proven behaviour. To validate it, create an array output using functions supported by the target edition and check TYPE on the intended expression, recording the build, locale, formula and observed result.
The Microsoft Excel TYPE page includes an additional 128 (compound data) classification. That does not establish a corresponding code in ONLYOFFICE: the checked ONLYOFFICE page lists only 1, 2, 4, 16 and 64. Do not add the Excel-only 128 behaviour to an ONLYOFFICE result table.
Source-backed distinctions: blank, array and evaluated result
The pinned ONLYOFFICE TYPE implementation explicitly maps numeric, string, Boolean and error objects to 1, 2, 4 and 16. A single-cell reference is dereferenced before that classification. Thus a formula producing "" is expected to give 2 when its evaluated result is an empty string; the test is not asking whether the cell contains a formula.
There is an important limitation to code 64: it is the routine’s fallback after the four explicit type checks. A synthetic empty-value object reaches that fallback too. This isolated source observation is not a claim that TYPE on every blank worksheet cell returns 64, because the surrounding engine may transform the argument before calling this routine. Do not use an unexpected 64 as proof that the original cell contains a meaningful array. Test a clear blank, an empty string and the intended array expression separately in the target editor. The source has distinct ordinary-range and array-formula branches, so a range cannot simply be substituted for a single-cell reference in an audit.
Advanced: compare content type with formula presence
Create TypeAndFormula, reserving A1:D8. Enter these exact values in A2:A7; =... entries are formulas. Put B2 =TYPE(A2), C2 =ISFORMULA(A2) and D2 =IF(B2=1,"Numeric result","Other result"), filling to row 7.
| Row | A entry | Expected B | Expected C | Expected D |
|---|---|---|---|---|
| 2 | 84 |
1 | FALSE | Numeric result |
| 3 | =42*2 |
1 | TRUE | Numeric result |
| 4 | ="84" |
2 | TRUE | Other result |
| 5 | =TRUE() |
4 | TRUE | Other result |
| 6 | ="" |
2 | TRUE | Other result |
| 7 | =NA() |
16 | TRUE | Other result |
Rows 2 and 3 have identical numeric values and TYPE codes but different formula-presence flags. Rows 4 and 6 are both strings despite having very different visual widths. Neither TYPE nor ISFORMULA establishes whether a value is sensible for the business field.
Duplicate the sheet as ChangedType and replace only A4 with numeric 84. Expected B4 changes from 2 to 1, C4 changes from TRUE to FALSE, and D4 becomes Numeric result. This deliberate replacement demonstrates what an import or paste-values step can change. Other rows remain untouched. The table and routing results are independently modeled, not native workbook observations.
Evidence date and scope: The fixed source revision above was retrieved and inspected on October 15, 2026. Cached Help Center references retain their stated October 13–14, 2026 checks. The isolated JavaScript tests use synthetic value/reference types; they do not execute a formula parser, complete calculation engine, workbook or graphical editor. No released-build mapping is inferred from the source commit.
Troubleshooting and common mistakes
| Observation | Why it happens | What to verify |
|---|---|---|
TYPE(A2) returns 1, though A2 displays 84 |
TYPE gives a code for numeric values, not the numeric value itself. | Understand type-code meaning. |
A digit-filled cell returns 2 |
It is text, perhaps from CSV import or leading apostrophe. | Inspect stored type; preserve identifiers when needed. |
A formula cell returns 1 instead of a special formula code |
TYPE classifies the formula result. | Use ISFORMULA to test formula presence. |
An error returns 16 |
All errors share the documented error type code. | Use ISNA/ISERR/ISERROR for a more specific classification. |
| A visually empty cell returns an unexpected type | Physical blanks and ="" differ. |
Inspect the formula bar; test with ISBLANK and ISTEXT. |
| Arrays behave differently across builds | Array support and input context may vary. | Run an edition-specific native fixture before making a compatibility claim. |
Cross-platform scope
The function is listed in the official unversioned English ONLYOFFICE Spreadsheet Editor function index. No release floor, full Docs-web/Desktop Editors compatibility matrix, or mobile-language behaviour was provided by the checked function article. The comparison with Microsoft’s documentation is evidence of related syntax and semantics, not a native import/export conformance test.
Official documentation and claim-by-claim checking
The exact function description and syntax are documented in ONLYOFFICE’s TYPE reference; the ONLYOFFICE Insert Function index lists it under the Information category. Both were checked on 2026-10-13 UTC. The index is unversioned online documentation, not an independently confirmed feature matrix for every Docs web, Desktop Editors or mobile version.
| Claim | Source | Verification |
|---|---|---|
Exact TYPE syntax and main return rule |
TYPE function reference | Documentation check only |
| Placement in vendor function inventory | Insert Function index | Documentation check only |
| English Formula-tab/manual entry and comma separators | Insert Function guide | English documentation check; locale variations untested |
| Cross-software context | Microsoft support | External documentation comparison only; not native compatibility test |
Verification limits: All table and advanced examples were independently classified from documented type/error rules and explicit inputs. No native ONLYOFFICE execution, localized formula test or cross-editor import test was performed. Blank, formula-empty and array edge cases remain qualified where noted.