Using "If cell contains #N/A" as a formula condition.

ExcelExcel Formula

Excel Problem Overview


I need help on my Excel sheet. How can I declare the following IF condition properly?

if A1 = "n/a" then C1 = B1
else if A1 != "n/a" or has value(int) then C1 = A1*B1

Excel Solutions


Solution 1 - Excel

Input the following formula in C1:

=IF(ISNA(A1),B1,A1*B1)

Screenshots:

When #N/A:

enter image description here

When not #N/A:

enter image description here

Let us know if this helps.

Solution 2 - Excel

You can also use IFNA(expression, value)

Solution 3 - Excel

"N/A" is not a string it is an error, try this:

=if(ISNA(A1),C1)

you have to place this fomula in cell B1 so it will get the value of your formula

Solution 4 - Excel

A possible alternative approach in Excel 2010 or later versions:

AGGREGATE(6,6,A1,B1)

In AGGREGATE function the first 6 indicates PRODUCT operation and the second 6 denotes "ignore errors"

[untested]

Solution 5 - Excel

use this formula to return the results for case of "FALSE"/"TRUE":

=IF(ISNA(A1)=TRUE, B1, A1*B1)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionbobbyjonesView Question on Stackoverflow
Solution 1 - ExcelWitchGodView Answer on Stackoverflow
Solution 2 - ExcelMicah ChaneyView Answer on Stackoverflow
Solution 3 - Excelbto.rdzView Answer on Stackoverflow
Solution 4 - Excelbarry houdiniView Answer on Stackoverflow
Solution 5 - ExcelcpbrView Answer on Stackoverflow