IF Function ignoring NA

Rookieeee

New Member
Joined
Aug 26, 2019
Messages
22
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
Joined
Oct 27, 2005
Messages
18,155
Office Version
2013
Platform
Windows
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")))
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
42,210
Office Version
365
Platform
Windows
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
Joined
Dec 30, 2008
Messages
7,149
Office Version
2019
Platform
Windows
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"}),"")
 

Forum statistics

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

Some videos you may like

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...
Top