N function

N converts a value to a number, returning the numeric equivalent of dates, booleans, and numeric text strings.

=N(value)

Generate a N formula

Describe what you need. The generator will reach for N where N is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How N reads its arguments
valuerequiredN
ArgumentRequiredDescription
valueRequiredAny value: a number, text, date, boolean, reference to a cell, or formula. N attempts to extract its numeric representation.

Returns

A number. For dates, the date serial number; for TRUE/FALSE, 1 or 0; for text numbers, the numeric value; for non-numeric text or empty cells, 0.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Extract quantity as a number for calculations

IngredientSupplierUnitQtyExpiry Date
Chicken BreastFresh Farmskg452026-09-20
=N(D2)

Result: 45

The quantity in D2 is stored as text '45'. N() converts it to the number 45, ensuring it can be used in arithmetic operations like SUM or AVERAGE. Without N(), text-formatted numbers might not calculate correctly in some contexts.

2. Convert expiry date to its serial number for date math

IngredientSupplierUnitQtyExpiry Date
Olive OilMediterranean CoL122027-03-15
=N(E2)

Result: 46379

Dates are stored internally as serial numbers. N(E2) returns 46379, the serial number for 2027-03-15. This is useful for date arithmetic: subtract one date serial from another to find the number of days between expiry dates in your inventory.

3. Convert low-stock alert from TRUE/FALSE to 1/0 for counting

IngredientSupplierUnitQtyExpiry Date
TomatoesLocal Marketkg302026-09-18
=N(IF(D2<20, TRUE, FALSE))

Result: 0

The IF formula returns FALSE (because 30 is not less than 20). N() converts FALSE to 0. If quantity were under 20, IF would return TRUE, and N() would return 1. This numeric format is easier to sum across rows to count how many items need reordering.

Common errors

Which N error are you seeing?
N returned an error#VALUE!
Wrap the formula in IFERROR or IFNA to handle missing values before N() receives them: =IFERROR(N(VLOOKUP(...)), 0)
#REF!
Correct the cell reference to point to a valid cell, or undo the deletion to restore the referenced cell.
#N/A
Use IFNA to catch #N/A before passing to N(): =IFNA(N(XLOOKUP(...)), 0)
ErrorWhy it happensHow to fix it
#VALUE!N() receives an error value from another formula, such as =N(VLOOKUP(item, range, 2)) when the lookup fails and returns #N/A or another error.Wrap the formula in IFERROR or IFNA to handle missing values before N() receives them: =IFERROR(N(VLOOKUP(...)), 0)
#REF!N() references a cell that was deleted or moved, such as =N(D2) after column D was removed from the sheet.Correct the cell reference to point to a valid cell, or undo the deletion to restore the referenced cell.
#N/AN() references a cell containing #N/A from a failed lookup, such as =N(XLOOKUP(item, range, result_range)) when no match is found.Use IFNA to catch #N/A before passing to N(): =IFNA(N(XLOOKUP(...)), 0)

Tips and when to use something else

  • N() always attempts conversion—use TYPE() or ISNUMBER() instead if you only want to check a value's type, not convert it.
  • For text strings, N() returns 0 in most spreadsheet implementations; to reliably parse text numbers, verify the source doesn't contain spaces or invisible characters.
  • Dates are a powerful use case: N() reveals the underlying serial number, which makes date subtraction simple (e.g., =N(expiry_date)−N(today) gives days remaining).
  • N() and ISNA() work well together: use ISNA() to detect #N/A errors before they reach N(), avoiding cascading errors in calculations.

Frequently asked questions

Why does N(TRUE) return 1 and N(FALSE) return 0?
In spreadsheets, TRUE and FALSE are boolean values. N() converts them to their numeric equivalents: TRUE becomes 1 (representing an on/active state), FALSE becomes 0 (representing an off/inactive state). This is standard in most spreadsheet systems and programming languages.
What happens when N() receives text that is not a number?
N() returns 0 for most non-numeric text. For example, N('apple') returns 0. If the text contains an error (like the result of a failed VLOOKUP), N() returns that error instead. To handle text carefully, pair N() with IFERROR().
Can N() convert currency text like '$50.00' to a number?
No, N() cannot parse currency symbols, commas, or percentage signs. It will return 0. If you need to extract numbers from formatted text, use SUBSTITUTE() to remove the symbols first: =VALUE(SUBSTITUTE(A1, '$', ''))
Why would I use N() instead of just referencing the cell directly?
N() is useful when you're unsure of a cell's format or want to guarantee a numeric result before calculations. For instance, if a column contains a mix of numbers and text, N() ensures a numeric output or 0, preventing unexpected calculation errors or text-in-numbers warnings.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17