
Converts a value to a number. Numbers stay the same, TRUE becomes 1, FALSE becomes 0, and text becomes 0.
The Excel N function converts a value to a number. If the value is already a number, N returns that number. If the value is TRUE, N returns 1. If it is FALSE or text, N returns 0.
N can also return the serial number of a date, because Excel stores dates as numbers internally. If the input is an error value, N returns the same error. Microsoft notes that N is mainly provided for compatibility, because Excel usually converts values automatically when needed.
Even so, N has a few practical uses. It can coerce logical values into 1 or 0 for arithmetic, and it is also known for the small formula-note trick where text inside N("comment") adds zero but still leaves a readable explanation in the formula bar.
Turns different kinds of values into a numeric result when possible.
Returns a number, 1, 0, a date serial, or the original error value.
=N(value)
N takes one argument: the value you want to convert. That value can be a number, text, a logical value, a date, or a reference to a cell containing one of those values.
The result depends on the type of value you pass into the function.
| Input Type | Example | N Result |
|---|---|---|
| Number | 123 | 123 |
| Date | TODAY() | The date serial number |
| TRUE | TRUE | 1 |
| FALSE | FALSE | 0 |
| Text | "hello" | 0 |
| Error | #DIV/0! | The same error |
N is not a common everyday function, but it still appears in a few useful patterns. One pattern is converting logical tests into numbers, such as turning TRUE and FALSE into 1 and 0. Another is adding text comments inside a formula with N("note"), because text passed to N becomes 0 and does not change the calculation.
It is also important to know what N does not do. It does not turn text like "7" into the number 7. Because that input is still text, N returns 0. It also does not suppress errors. If you pass an error into N, the error stays an error.
If the input is already numeric, N simply returns it. This is the simplest case and also the least interesting one, but it helps show that N does not alter normal numeric values.
=N(100) // Returns 100
=N(A1) // If A1 contains 123, returns 123
In cell B1, use N on the numeric input row.
This is one of the most practical uses of N. It turns logical values into numbers, which can then be summed, averaged, or used in arithmetic formulas.
=N(TRUE) // Returns 1
=N(FALSE) // Returns 0
In cell B3, use N on a logical value.
When the input is plain text, N returns 0. That behavior can be useful in a narrow set of formulas, but it also means N is not a replacement for proper type conversion tools.
=N("Manual Note") // Returns 0
=N(B1) // If B1 contains "hello", returns 0
In cell B2, use N on the text input row.
This is a classic N trick. Because text becomes 0, you can place a note inside the formula and keep the result unchanged. The note remains visible in the formula bar for anyone reviewing the workbook.
=A1 + N("Reviewed by QA")
// Returns the same result as =A1, because N("Reviewed by QA") returns 0
In cell B4, use N inside IF to label a text value.
Remember that N passes errors through unchanged. If the input is #DIV/0!, #N/A, or another error, N returns that same error. If you need to replace errors with 0, use IFERROR around the formula instead.
N is a small compatibility-style function that turns certain kinds of values into numbers. This lesson showed that it is most useful for two narrow jobs: converting TRUE and FALSE into 1 and 0, and adding hidden notes inside formulas with N("comment").
The key thing to remember is what N does not do. It does not turn normal text like "7" into the number 7, and it does not remove errors. That is why it is helpful in a few specific patterns, but not a general-purpose conversion tool.
N converts values to numbers when possible.=N(value).Tell your friends about this post