T in Calligra Sheets: Keep Text and Ignore Numbers
Learn when the Calligra Sheets T function returns the original text and when it returns an empty string, with reproducible examples.
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: =T("Calligra") returns the text Calligra, while =T(1.2) returns empty text (an empty string, not the number zero). T is a text-only filter, not a general text-conversion tool. These two examples are published in KDE’s official T reference. The behaviour is also implemented directly in version-pinned C++.
Scope and validation: Applies to the registered T function in KDE’s Calligra 26.08.2 source, released 2026-10-08; official English KF6 handbook, source and XML help accessed 2026-10-12. Worksheet results below are expected, established by official documentation, source inspection and independent reasoning. We did not execute Calligra Sheets.
What T does (and does not do)
T helps you pass through human-readable labels, notes or identifiers while preventing numeric cells from contributing accidental text to a downstream string expression. It accepts a literal value or cell reference. When the internally evaluated argument is a string, T returns that string. If it is not a string, it returns an empty string. In the inspected implementation, isString() determines the branch; there is no separate date or boolean formatting rule within T. Source: func_t, lines 668–675.
This distinction matters for spreadsheets containing both product names and quantities. T(A2) can retain a product name, but T(B2) will not turn a numeric quantity into the characters of its number. If you need text conversion instead, consider TEXT(value). Do not substitute T for TEXT without checking intended types.
Exact syntax, argument order, defaults and locale
=T(value)
| Argument | Required | Official XML type | Accepted meaning | Default |
|---|---|---|---|---|
value |
Yes | Any | Literal, expression or cell reference to inspect | None |
The official shipped XML documents one argument, return type String, and no optional defaults. The pinned registration calls new Function("T", func_t) with no additional setParamCount or explicit alternate name. T itself uses one argument and therefore does not require a separator. Multiple-argument formulas used elsewhere in the English Calligra handbook normally separate arguments with semicolons (;); localized input conventions may vary. 1.2 in this guide is an English-decimal numeric literal; if your locale uses a comma decimal mark, adapt numeric input accordingly. A literal string such as "007" is still text regardless of display formatting.
There is no documented T alias in the canonical Calligra 26.08.2 inventory. A visually similar value can have a different underlying type: a cell containing the literal text "007" is different from numeric 7 with a 000 display format.
Follow-along worksheet: notes versus quantities
Create this small sheet using text cells for A2:A5 and actual numeric cells for B2:B5. Enter the formulas in columns C and D, then fill them down.
| Row | A: text input | B: numeric input | Formula in C | Expected C | Formula in D | Expected D |
|---|---|---|---|---|---|---|
| 2 | KDE |
12 | =T(A2) |
KDE |
=T(B2) |
empty text |
| 3 | AB-003 |
0 | =T(A3) |
AB-003 |
=T(B3) |
empty text |
| 4 | North |
8 | =T(A4) |
North |
=T(B4) |
empty text |
| 5 | 007 (stored as text) |
7 | =T(A5) |
007 |
=T(B5) |
empty text |
The input-type distinction is the result: the string is retained, but numeric cells produce empty text. These are expected source-derived outputs, not screenshots or native-application measurements. If you paste 007 into A5 and the spreadsheet automatically changes it to numeric 7, explicitly format the cell as text before entering it and check its type.
Literal and nested-function examples
| Formula | Expected result | Why |
|---|---|---|
=T("Calligra") |
Calligra |
Official example: input is text |
=T("AB-003") |
AB-003 |
Identifier remains text |
=T(1.2) |
empty text ("") |
Official example: number is not text |
=T(0) |
empty text ("") |
Zero is a number, not an empty string |
=T("") |
empty text ("") |
The input itself is an empty string |
=T(LEFT("BOOK";2)) |
BO |
LEFT’s output is text |
=T("007") |
007 |
Quoted digits remain text |
=T(12+3) |
empty text ("") |
Arithmetic produces a number |
Independent validation: the LEFT("BOOK";2) substring and 12+3 calculation were reasoned independently. Type-dependent T outcomes follow the pinned C++ branch. No displayed error spelling is claimed.
Useful advanced patterns
Append only text remarks. Suppose A2 is a note and B2 is a numeric score. The formula =CONCATENATE("Note: ";T(A2)) is expected to append A2 if it contains text. Putting T(B2) in place of T(A2) will contribute no numeric digits; use that property intentionally, not accidentally. CONCATENATE is separately documented in the KDE function handbook.
Show a fallback message for non-text inputs. For a cell A2 that may be textual or numeric, the conditional =IF(T(A2)="";"No text supplied";T(A2)) is expected to display No text supplied for both a numeric value and an empty text cell. This pattern cannot distinguish empty text from numbers, so use a separate type check if you must know why the result is empty. IF is independently documented at the official IF reference.
Avoid a type assumption. To preserve all values as displayable text, =TEXT(A2) is conceptually different from =T(A2) in this release. The first converts using Calligra’s value-to-string routine, while the second suppresses non-strings. See the pinned T and TEXT implementations.
Errors, limitations and troubleshooting
- A quantity disappears: this is normally expected. The source explicitly returns an empty string for non-string values; check the actual type, not just how the cell appears.
- Leading zeros disappear before T runs: spreadsheet import or numeric conversion may already have transformed
007into7. Keep the original column as text; T cannot reconstruct lost leading zeros. - An empty cell and a numeric cell look the same after T: the result is empty text in either case; neither equals a guaranteed visual placeholder. Use another type predicate when this distinction matters.
- A formula error is present in the input: error propagation can depend on evaluation before
func_treceives its argument. The inspected function body does not prove every spreadsheet-engine error path. Test errors in a native version before documenting specific rendered error codes. - A date becomes empty or not: date serial/value types depend on the cell engine, not just what appears on-screen. The pinned T code looks at
isString()only. Verify the stored type instead of assuming date-display text is a string. - Unexpected commas or separators: verify the worksheet’s current locale. T has no separator internally; the worked example’s IF and CONCATENATE use the English handbook’s semicolon convention.
There is no documented limit or optional default specific to T in the shipped XML. The scope does not cover every conversion, nested-error or extension-function edge case.
Excel and LibreOffice compatibility
Microsoft documents Excel T(value) as returning the referenced text or empty text for non-text inputs, a close conceptual match. Calligra’s pinned code is its own implementation; matching syntax is not proof of identical type coercion for all errors, dates, booleans and arrays. LibreOffice users should verify representative imported cells and locale-specific handling before assuming the displayed outcomes will match. Do not confuse Excel TEXT(value,format_text) with T: they have different goals and required arguments.
Related functions and checked references
The relevant vendor references are TEXT for conversion, LEFT for extracting text, IF for conditional decisions and CONCATENATE for joining strings.
Official evidence and access dates
- Official KDE T handbook — purpose, argument, return and two examples; checked 2026-10-12.
- KDE 26.08.2 shipped T XML — exact one-argument syntax and Any type; checked 2026-10-12.
- KDE 26.08.2 T registration — canonical registration; checked 2026-10-12.
- KDE 26.08.2
func_tC++ — checks whether the input is a string; checked 2026-10-12. - Official KDE 26.08.2 release announcement — 2026-10-08 release; checked 2026-10-12.
Validation: Official documentation, immutable source and independent example reasoning were checked. No native Calligra execution, platform/locale tests or workbook interchange tests were performed.