# IF Function ignoring NA

#### Rookieeee

##### New Member
Hello guys,

I am currently processing a huge dataset. My question is that how can I ignore NA when I want to run and repeat this function in excel.
Code:
``=IF(AND(RankLN!D45>0.3,RankLN!D45<=0.7),"M",IF(RankLN!D45>0.7,"W","L"))``
In detail, for example, I have a column, we say column D. In this column, I have huge number of values between 0-1 and some NA, what I need to do is to rank and divide 0-1 using 'W', 'M', 'L'. However, in this column I have NA, so how can I ignore NA?

Thank you so much

Last edited:

#### Michael M

##### Well-known Member
Maybe this

Code:
``=IF(RankLN!D45="NA","",IF(AND(RankLN!D45>0.3,RankLN!D45<=0.7),"M",IF(RankLN!D45>0.7,"W","L")))``

#### Rookieeee

##### New Member
Maybe this

Code:
``=IF(RankLN!D45="NA","",IF(AND(RankLN!D45>0.3,RankLN!D45<=0.7),"M",IF(RankLN!D45>0.7,"W","L")))``
It works, Thank you so much.

Cheers,

#### Peter_SSs

##### MrExcel MVP, Moderator
It works,
In that case your "NA" values must be text as opposed to actual error values like in your other thread with the same title?

BTW, for the formula being discussed in this thread,
- what is the name of the worksheet that it is on?
- are there any values in column D actually equal to 0 and/or 1 or are they all "between" as you described in post 1 here?

Last edited:

#### jasonb75

##### Well-known Member
Another way that you could do it.

=IFERROR(INDEX({"W","M","L"},MATCH(RankLN!D45,{1,0.7,0.3},-1)),"")

or possibly (decimal precision might need adjusting).

=IFERROR(LOOKUP(RankLN!D45,{0,0.30001,0.70001},{"L","M","W"}),"")

1,081,706
Messages
5,360,769
Members
400,595
Latest member
T_Dubs

### This Week's Hot Topics

• VBA (Userform)
Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
• List box that changes fill color
Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
• Remove duplicates and retain one. Cross-linked cases
Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
• VBA Copy and Paste With Duplicates
Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
• Macro
is it possible for a macro to run if the active cell value is different to the value above it
• IF DATE and TIME
I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...