Contact

N in Calligra Sheets: Convert a Value to a Number

Information Intermediate Calligra Sheets

Understand Calligra numeric conversion for numbers, numeric text, logical values, blanks and dates.

Verification status: Consult the documentation, examples and any stated test scope below. How formula examples are checked

Quick answer: N(value) converts a value through Calligra’s floating-point converter. Numbers retain their numeric value, TRUE becomes 1, FALSE becomes 0, and ordinary nonnumeric text is converted to 0. Crucially, Calligra can parse numeric text: =N("12.5") produced 12.5 in the native test, not zero.

Use N only when those conversion rules match the task. It is not a validation test: converting a missing or malformed entry to zero can hide a data problem.

Syntax and conversion rules

=N(value)

The one required argument can be a literal, expression or cell reference. There are no optional arguments and no default. The function directly calls the engine’s asFloat converter.

Input kind Source conversion behavior
Integer or floating-point number Numeric value retained.
TRUE / FALSE 1 / 0.
Empty cell 0.
Text recognized by the number parser Parsed numeric value.
Text not recognized as numeric 0.
Date/time numeric value Underlying numeric representation; display formatting is a separate matter.

The converter contains an error-to-zero branch, but formula evaluation may propagate an error before the function is called. Therefore, N(1/0) must be tested in the application before claiming that N suppresses division errors. The native probe below returned 0 for this exact case in 25.04.2. Do not treat that as a general guarantee that N safely suppresses every error.

Worked worksheet: make a logical flag explicit

Suppose B2 holds the logical formula =TRUE() and B3 holds =FALSE(). These cells represent a simple yes/no flag, not text strings spelling the words.

  1. Put Flag in A1 and Numeric flag in C1.
  2. Enter =N(B2) in C2 and fill down to C3.
  3. Independently expected C2 is 1 and C3 is 0.
  4. If a completed task is worth 10 points, =10*C2 gives 10 points and =10*C3 gives 0 points.

This converts a logical result into a numeric weight. It does not verify that the source flags were valid Boolean values. A mistyped text entry could be mapped to zero and look like a legitimate FALSE.

Numeric text is product-specific

Enter the literal text 12.5 in a text-formatted input cell, and the ordinary word text in another. The source predicts that N parses the numeric text as 12.5, while the ordinary word becomes 0. The exact decimal/grouping syntax recognized by the parser depends on locale, so do not generalize the English decimal-point test to every import format.

A common formula-annotation pattern in other spreadsheets adds N(“comment”) because ordinary words convert to zero. In Calligra, do not assume that every quoted string contributes zero: a comment consisting of numeric-looking text can change the result. Prefer a dedicated note or comment feature when the goal is documentation rather than conversion.

Advanced example: keep missing-data policy explicit

Suppose measurements arrive as a mixture of valid numbers, numeric text, blanks and failed imports. Applying N to the entire column may turn both blank and invalid text into 0. An average of the converted column would then treat them as real zero measurements.

For example, valid measurements 10 and 20 have mean 15. Adding a missing third observation as a converted zero changes the mean to 10. Neither answer is automatically correct: the missing-data policy determines whether that record should be excluded, imputed or corrected.

Use a separate validation step to distinguish expected numeric text from invalid text and blanks. N alone cannot tell you which zero came from an actual measurement and which came from conversion failure. Retain the original input while cleaning data.

Dates, errors and troubleshooting

  • A date is not converted into a year number. N applied to a numeric date exposes a serial-like underlying numeric value; its interpretation depends on the document’s date system and formatting. Do not use N as a substitute for a year-extraction function.
  • Format an output as a number when inspecting conversion. A date-formatted output cell can make an ordinary numeric result look like a calendar date.
  • N(1/0) returned 0 in the native test. This can conceal a division error, so N should not replace explicit error handling or input validation.
  • N(value1;value2) has too many arguments under the one-argument registration.
  • Text that uses a different decimal mark, grouping convention or unit suffix may fail parsing and become zero. Verify imported text deliberately.

KDE ISNUMBER tests a value’s numeric type rather than converting it; KDE ISTEXT tests text. KDE VALUE is another conversion function whose exact error and parsing rules should be checked separately.

Do not import the assumption that N always maps text to zero from another spreadsheet. Calligra delegates to its parser-backed numeric converter, and workbook portability requires tests of numeric text, nonnumeric text, blanks and errors rather than just a numeric literal.

Availability, sources and test scope

Checked October 18, 2026. Original introduction date is unknown. The function is registered in Calligra 26.08.2 source; the relevant mathematics, statistical and information-function source plus numeric engine/converter files are byte-identical in the separately retrieved 25.04.2 source. This establishes source availability in both releases, not an introduction date. Native tests used Calligra Sheets 25.04.2 on Linux, October 18, 2026. The tables below record formulas recalculated in that application and read from its completed saved ODS workbook. Source inspection of 26.08.2 is separate; no native 26.08.2 run is claimed.

Primary references: KDE N handbook, 26.08.2 function implementation, numeric calculation engine and numeric converter. The handbook is an unversioned living page; the source links identify the inspected release. The native table identifies the exact cases with confirmed application error labels; other source-derived cases are not claimed as runtime tests.

Native verification in Calligra Sheets 25.04.2

The following formulas were recalculated in the actual Linux application on October 18, 2026. Results were checked in the completed native-saved workbook. The screenshot is an unmodified application capture; it is not a simulated worksheet. The model examples above are independent mathematical explanations, and only the formulas below are claimed as executed tests.

M5 was genuinely blank. The date example returned 46023 in this workbook; this is an observed serial value, not a portable date-system constant. The division-error expression returned 0, illustrating why a conversion result must not be treated as proof of valid input.

Calligra Sheets 25.04.2 showing N formulas, input cells and native results

Formula executed Native result
=N(12.5) 12.5
=N(TRUE()) 1
=N(FALSE()) 0
=N("12.5") 12.5
=N("text") 0
=N(M5) 0
=N(1/0) 0
=N(DATE(2026;1;1)) 46023

These observations are specific to the tested release, settings and inputs. They do not establish all coercions, precision limits or cross-application import behavior.