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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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,215,480
Messages
6,125,050
Members
449,206
Latest member
Healthydogs

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