ID EN
#Information

N

Excel Functions

Convert a value to a number

Syntax

EXCEL
=N(value)

Arguments

Parameter Description
value The value to convert to a number.

Return Value

A number or error code

Details

Use the N function to convert value to a number. The N function takes one argument, value, which can be a cell reference, a formula result, or a hardcoded value. Values are converted as shown below. The logical values TRUE and FALSE are converted to 1 and 0, and text values are converted to zero. Numeric values and errors are unaffected. The N function is provided for compatibility with other spreadsheet programs. In most cases, using the N function is unnecessary, because Excel automatically converts values when needed. However, the N function is a simple way to convert TRUE and FALSE to their numeric equivalents, 1 and 0, as mentioned below. The N function converts text values to zero: Numeric values and errors are not affected: The N function converts TRUE to 1 and FALSE to zero:

Examples

Examples

The N function converts text values to zero:

EXCEL
=N("apple") // returns 0
Examples

Numeric values and errors are not affected:

EXCEL
=N(100) // returns 100
=N(5/0) // returns #DIV/0!
Examples

The N function converts TRUE to 1 and FALSE to zero:

EXCEL
=N(TRUE) // returns 1
=N(FALSE) // returns 0
=N(3>1) // returns 1
=N(3<1) // returns 0
Examples

There are several ways to perform this conversion in Excel, which is useful in more advanced formulas. For example, the formula below will return a co

EXCEL
=SUMPRODUCT(N(LEN(range)>100))

See Also

T