If function ignoring NA

Rookieeee

New Member
Joined
Aug 26, 2019
Messages
22
Hello guys,

I have a column of numbers and some NA. I am creating dummy variables, for example, IF(A2>0.7,1,0) and repeat this function into the entire column. However, I have NA in this column. Therefore, how can I ignore NA and set the output of NA as 'NO'.

Thank you so much.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
I have a column of numbers and some NA. I am creating dummy variables, for example, IF(A2>0.7,1,0) and repeat this function into the entire column. However, I have NA in this column. Therefore, how can I ignore NA and set the output of NA as 'NO'.
Maybe....

=IFERROR(IF(A2>0.7,1,0),"NO")

or possibly...

=IF(A2=NA(),"NO",IF(A2>0.7,1,0))
 
Last edited:
Upvote 0
or possibly...

=IF(A2=NA(),"NO",IF(A2>0.7,1,0))
For me, that returns #N/A for all values in A2 except errors other than the #N/A error

If we only want "NO" returned for #N/A errors and not other errors then for your version (I think 2010?) you would need
=IF(ISNA(A2),"NO",IF(A2>0.7,1,0))

or for subsequent versions the If(ISNA .. has been compressed into a single function
=IFNA(IF(A2>0.7,1,0),"NO")
@Rookieeee
Also note that in any of the suggeted formulas IF(A2>0.7,1,0) can be replaced by --(A2>0.7)
For example, the formula you chose can also be written as
=IFERROR(--(A2>0.7),"NO")
 
Upvote 0
For me, that returns #N/A for all values in A2 except errors other than the #N/A error

If we only want "NO" returned for #N/A errors and not other errors then for your version (I think 2010?) you would need
=IF(ISNA(A2),"NO",IF(A2>0.7,1,0))

or for subsequent versions the If(ISNA .. has been compressed into a single function
=IFNA(IF(A2>0.7,1,0),"NO")

@Rookieeee
Also note that in any of the suggeted formulas IF(A2>0.7,1,0) can be replaced by --(A2>0.7)
For example, the formula you chose can also be written as
=IFERROR(--(A2>0.7),"NO")

Wow, Amazing. Thank you for your help!!!
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,181
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top