Nested IF/OR/VLOOKUP

DJEinConcord

New Member
Joined
Mar 12, 2009
Messages
3
Nested IF/OR/VLOOKUP
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p> </o:p>
Hello Forum,
<o:p> </o:p>
New member, seasoned Excel user with a fairly hard one for the boards.
<o:p> </o:p>
What I am trying to do is run a check on a returned spreadsheet I sent to users for them to fill out. First check is to see if the users filled in the cell with anything, and second check is if what they filled in is a valid selection from a named range of data (CatApprovLevl).
<o:p> </o:p>
In English I am trying to see if the value in cell D14 is 0, if it is I want a return value of “Blank” letting me know the user did not enter any data at all.
<o:p> </o:p>
Then if they did enter something I want to check what they entered was a valid entry by checking that data against a range(CatApprovLevl). If it is in the range, I want a returned value of “OK.”
<o:p> </o:p>
If they entered a value not in my range (CatApprovLevl) I want a returned value of “Error.”
<o:p> </o:p>
I am getting the dreaded #N/A instead of the expected “ERROR” value.
<o:p> </o:p>
Here is the faulty code:
<o:p> </o:p>
=IF(D14=0,"Blank",IF(OR(D14=VLOOKUP(D14,CatApprovLevl,1,FALSE)),"OK","Error"))
<o:p> </o:p>
<o:p> </o:p>
Assumptions:
<o:p> </o:p>
The range of data is valid and correct entries are judges against it and return “OK” values.
<o:p> </o:p>
It is the bad entries, not in the list, that give the cursed #N/A .
<o:p> </o:p>
Thanks for looking!

DJE
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Thanks Aladin.

It returned all ERRORS and BLANKS, but no OKs. There are lots of OK entries.

The values int the named range are text. Would that matter with the ISNUMBER function?
 
Upvote 0
Thanks Aladin.

It returned all ERRORS and BLANKS, but no OKs. There are lots of OK entries.

The values int the named range are text. Would that matter with the ISNUMBER function?

IsNumber is not the problem for it checks whether Match returns a number. The Match function returns an integer (number) when successful, otherwise #N/A.

Does...

=IF(D14="","Blank",IF(ISNUMBER(MATCH(TRIM(D14),INDEX(CatApprovLevl,0,1),0)),"OK","Error"))

succeed?
 
Upvote 0
Thank you!

This one wokred:

=IF(D14="","Blank",IF(ISNUMBER(MATCH(D14,INDEX(CatApprovLevl,0,1),0)),"OK","Error"))

I must have done something wrong when I first tried it. It works great!

Thanks again.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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