I am not looking for a specific solution in Excel, just trying to understand a few key difference between certain data types.

Imagine this, I have error code `#N/A`

in `cell A1`

.

I copy and paste this error code in `cell A1`

as `Value`

(now the red triangle in the top left corner is gone).

I run the following formula in `cell B1`

: `=IF(A1="#N/A","Yes","No")`

.

This returns an `#N/A error`

.

But when I change the value in `cell A1`

to `'#N/A`

, the formula works correctly; it returns `Yes`

in `cell B1`

. If I change the value in `Cell A1`

to `N/A`

, the formula works correctly as well.

`#`

is being seen by Excel as `Text`

. If for instance I have `#`

in `cell A1`

, and I ask Excel whether this is text using `=ISTEXT(A1)`

, Excel returns a `True`

value. If I change the value in `cell A1`

to `#N/A`

, it is no longer seen as text.

So, my question, why does Excel not treat `'#N/A`

, `#N/A`

, `N/A`

, and `#`

the same?

When the #N/A error code comes up as the result of a formula, Excel is saying “This cell has a not-available type error”. When you enter the value of ‘#N/A into a cell, Excel is saying “This cell has a text/string value of the characters ‘#N/A”. What’s happening in each cell is not equivalent to Excel.

You probably want to incorporate the IFERROR or ISNA function into your formula. Right now your code is searching for the later example, the text/string value of ‘#N/A. You need to use a function that is looking for an error, not a string of text.

Tags: excelexcel