N Function

Excel 2007+

Summary

The Excel N function converts a value to a number according to specific conversion rules. It returns the numeric value for numbers and dates, converts TRUE to 1 and FALSE to 0, preserves error values, and returns 0 for all other inputs like text.

Syntax

N(value)

Parameters

Parameter Type Required Description
value Any Yes The value you want to convert to a number. Numbers return unchanged, dates become serial numbers, TRUE=1, FALSE=0, errors preserved, others=0

Using the N Function

The N function provides consistent numeric conversion for mixed data types. While Excel automatically handles most type conversions, N ensures predictable results across different input types, making it valuable for data processing and compatibility with other spreadsheet applications.

Common N Examples

Basic Number Conversion

=N(A1)

If A1 contains 7, returns 7. If A1 contains 'Even', returns 0.

Logical Value Conversion

=N(TRUE)

Converts TRUE to 1.

Date Serial Number

=N(DATE(2011,4,17))

Returns 40650 (serial number for April 17, 2011).

Text Handling

=N("7")

Returns 0 since it's text, not a number.

Frequently Asked Questions

N provides explicit, predictable conversion rules and maintains compatibility with other spreadsheet programs.

No, text like '123' returns 0, not 123.

Error values like #DIV/0! are returned unchanged.

Common Errors and Solutions

Unexpected 0 result

Cause: Input is text or unrecognized type

Solution: Use VALUE() function for text-to-number conversion

Wrong date serial number

Cause: Different Excel date system (1904 vs 1900)

Solution: Check File > Options > Advanced > 'Use 1904 date system'

Notes

  • Provided mainly for compatibility with other spreadsheet applications
  • Excel stores dates as sequential serial numbers starting from January 1, 1900 = 1
  • Not typically needed in modern Excel formulas due to automatic type conversion

Compatibility

Available in: Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Microsoft 365

Not available in:

Content last reviewed: December 11, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+