
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.
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 F1, use N on A1. Since A1 contains 123, the result should stay 123.
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 F3, use N(TRUE). Expected result: 1.
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 F2, use N on B1. Since B1 contains text, the result should be 0.
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 F4, use IF with N(B1) to label the text value in B1 as "String".
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 converts values to numbers when possible.=N(value).Tell your friends about this post