How to check whether a cell is not equal to #N/A & if so include that with another cell to check both are same
2 Answers
=IF(ISNA(A1),"Do nothing", "Then do what want, such as SUM(A1+A2)")
I think should get you going.
A real example would be
=IF(ISNA(A1),"", B1+A1)
What Dave offered will work, using IF(ISNA(...))
However, it may be a bit shorter to employ the IFERROR() function. If you want to sum A1 and B1, returning an empty string if either are N/A, then use:
=IFERROR(A1+B1,"")
Or, if you want to compare values in B1 and B2, and return "same" or "not same", and handle #N/A conditions, then use:
=IFERROR(IF(B1=B2,"same","not same"),"not same due to error")
-
How is this shorter? My offering
=IF(ISNA(A1),"", B1+A1)
is shorter than=IFERROR(IF(B1=B2, B1+A1,""),"")
by 9 characters?! It's also less convoluted as you don't have multiple "else" statements. You can make it shorter, by simply usingIFERROR(A1=B1,"")
but only by 4 characters! :)– DaveMar 9, 2016 at 12:47 -
@Dave If the objective is to simply add two cells, returning "" if either are #N/A, then it would be
IFERROR(A1+B1,"")
, which is shorter (and also has the advantage of handing #N/A in either A1 or B1. Mar 9, 2016 at 17:36
=IFERROR(A1=B1,"one of the cells contains error")
?