Text

N Formula

N converts a value to a number: numbers pass through unchanged, TRUE becomes 1, FALSE becomes 0, dates become serial numbers, and everything else becomes 0. It is useful for coercing logical values to numbers in formulas and for adding inline comments.

Syntax

N(value)
ParameterDescription
value Parameter of the N function.
Try N in Viztab — free, no signup

Examples

Convert logical to number

Formula
=SUM(A1:A10) + N(B1="Bonus")*500
Adds 500 to the sum only when B1 is "Bonus". N converts the TRUE/FALSE result to 1/0 for multiplication.

Inline formula comment

Formula
=A1*0.08 + N("Sales tax rate")
N("Sales tax rate") returns 0, adding nothing to the result but serving as a readable comment inside the formula.

Date to serial number

Formula
=N(DATE(2026,1,1))
Returns 46023 (the serial number for Jan 1, 2026). Useful when you need the raw date number for calculations.

Common Errors

#VALUE!

Occurs if the argument is an error value. N does not suppress errors — they pass through.

Tips

Inline comments trick

N("your note here") always returns 0, so you can add it anywhere in a formula as a self-documenting comment without affecting the result.

TRUE = 1, FALSE = 0

N is the explicit way to convert booleans to numbers. In most formulas you can also multiply by 1 or add 0 to achieve the same thing.

Works on dates

N converts a date to its serial number. This is the same number you'd see if you formatted the date cell as a number.

Try N in Viztab

Import your data and use N with 370+ other formulas. No signup required.

Open Viztab

Related Formulas