0

I have a column of data. I want to find all the values that do not equal any values from an array, one by one.

I tried defining a named value which was an array like this

={"value1","value2","value3","value4","value5"}

..and so on.

Which excel functions can I use to find values that are not contained in the array.

And why is the function not iterating through the array? It's only testing the first index.

I tried this: {=NOT(X8=NamedValue)}

And =MATCH(NamedValue, X3,0)

Both only test the first value in the array.

2
  • Should be clear that the values are strings. Commented Aug 12, 2014 at 4:46
  • It looks like the easiest way to do this would be to define an array constant and then pass that into the lookup_value though I still can't get excel to iterate past the first value. Commented Aug 12, 2014 at 5:32

2 Answers 2

2

You should use Excel's MATCH() function for this purpose. Supply 0 to the match_type parameter. More information can be found on this link.

Examples of usage:

Pass hard-coded list of values to the formula:

=MATCH("dfs", {"erw","sad","dfs"}, 0)

Pass cell range to the formula:

=MATCH("dfs", C1:C15, 0)
Sign up to request clarification or add additional context in comments.

4 Comments

I tried this and I'm getting the same result as my test. =MATCH(NamedValue, X3,0)
I found this article as well: office.microsoft.com/en-us/excel-help/… But neither mentions passing in an array as the lookup_value
I just checked and =MATCH("def", {"abc","def","ghi"}, 0) correctly returns 2 for me.
My understanding is that the first parameter, in this case "def" is the lookup_value, which should be the array of values I want to return true for. Then the lookup_array should be the complete list of values, returning false for any string that isn't in the array.
0

Assume column A is your list of "good values", column B is list of all values.

A B value2 value1 value3 value2 value4 value3 value4 value5 Place the following formula in C1, and copy down

=IF(ISNA(VLOOKUP(B1,$A$1:$B$5,2,FALSE)),0,1)

Which will place a "1" in the the rows where there is a match, and false otherwise.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.