N function
N converts a value to a number: numbers stay as they are, TRUE becomes 1, dates give serial numbers and anything else gives 0. It mostly shows up in old formulas and as a trick for adding comments.
Example
Read it as a sentence: turn the value in F3 into a plain number, which gives 45351.
Excel shows 45351
F
1
2
'123
3
2024-02-29
Data
Syntax
N(value)
-
value(required) - The value to convert.
Returns: A number: numbers stay, TRUE is 1, dates give serials, anything else 0.
What Excel actually returns
Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.
| Formula | Excel shows | Case |
|---|---|---|
=N(5) | 5 | Number |
=N("5") | 0 | Text |
=N(TRUE) | 1 | Bool |
=N({1,"a"}) | 1 | Array |
=N(Data!F3) | 45351 | Date cell |
=N(Data!F1) | 0 | Blank |
=N(Items!B2) | 0 | Text cell |
=N(Data!F5) | #DIV/0! | Error cell |
The Data sheet these formulas read
A cell that starts with = holds that formula.
F
1
2
'123
3
2024-02-29
4
TRUE
5
=1/0
Data
The Items sheet these formulas read
B
1
Item
2
Boxer cartridge
Items
Watch out for
- Text becomes 0, even "7".
- Only the first item of an array is used.
Where it works
- Excel
- N is in every version of Excel from 2007 on.
- Google Sheets
- Same name, same behaviour for everyday use.
Part of Information functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .