## How to use the N function

**What is the N function?**

The N function returns a value converted into a number.

The N function in Excel is rarely needed to convert values in formulas. Excel automatically handles conversion of numbers, text, logical values, and error values as required. N is provided for compatibility with other spreadsheet applications. In most cases, Excel will format values correctly without requiring the N function.

Only use N if you find Excel is not properly converting a value to text in a specific formula. In general, you can avoid using it entirely since Excel auto-converts types seamlessly in most situations.

**How does Excel handle values?**

Excel changes the position of the value in a cell based on the value type. For example:

- Cells B2 and B8 contain text values that are aligned left.
- Cell B3 contains a number that is right aligned in the cell.
- Cell B4 contains a date, which Excel handles as a number. The date is right aligned.
- Cells B5 and B6 contain boolean values, which are automatically centered in the cell.
- Cell B7 contains an error value, which is also centered.

Note, the user may have changed the cell formatting making these guidelines useless. To revert back to default settings check that the align buttons are not selected:

- Align left
- Center
- Align right

**What is the difference between the T and N function?**

The T function deletes numbers and dates, the N function removes text values.

**What other functions let you identify/format/convert values?**

ISTEXT functionÂ |Â TEXT functionÂ |Â VALUETOTEXT function | T function

### N function example

The N function in cell C3 contains a cell reference to cell B2. B2 contains a number, the N function returns the number.

Formula in cell C3:

Cell B4 contains a date, Excel dates are actually numbers and numbers return the number itself. Cells B5 and B6 are TRUE and FALSE respectively, the T function returns the corresponding numerical values which are 1 and 0.

Cells B7 and B8 contain an error value and a text value, the N function returns the same error value but the text value is ignored and 0 (zero) is returned.

### N function Syntax

N(*value*)

### N function Arguments

value |
Required. The value you want to convert. |

### N function not working

The above image shows that the N function doesn't return numbers, dates and boolean values, why does that happen? Select these cells to evaluate the values in the formula bar.

The apostrophe character converts numbers, dates and boolean values to text values, there is no way to tell unless you select one of the values and examine the formula bar. This sometimes happen when you import data from databases, the internet, and other sources.

The #NAME error appears if the function name is misspelled.

Other errors may have their origin in the source data. Check the source data for errors.

**Can I use the N function in an array formula?**

No, it returns only the first value in an array. The example above demonstrates that the N function returns the first value in the cell range B3:B8 which is 23. The remaining values in cell range B3:B8 are ignored.

### Functions in 'Information' category

The N function function is one of many functions in the 'Information' category.

## How to comment

How to add a formula to your comment<code>Insert your formula here.</code>

Convert less than and larger than signsUse html character entities instead of less than and larger than signs.

< becomes < and > becomes >

How to add VBA code to your comment[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

How to add a picture to your comment:Upload picture to postimage.org or imgur

Paste image link to your comment.

Contact OscarYou can contact me through this contact form