Items - Finding
If your array contains less than 100,000 elements then looping through once is very efficient.
Exactly which method you use will depend on the following questions:
1) Is the array 1 dimensional or multi-dimensional.
2) Are you looking to conduct an exact match or just a partial match.
3) Do you need to know the position of the item if it exists.
4) How many searches do you need to do, it might be worth sorting the array.
5) How often is the data changing, you may need to keep re-sorting.
Exact Match
If you are using Excel VBA you can use the Excel MATCH worksheet function.
You can use the FILTER function to tell if an item exists in a one-dimensional array.
This function returns an array of any elements that contain a given text string.
This function takes a string array, text string and returns a one-dimensional array containing all the elements that match the search string.
This method does not distinguish between complete matches and substring matches.
This method does not work with numerical arrays since all the numbers have to be implicitly converted to text first
You can use the INSTR function after converting the array to a string concatenation
This method also uses the JOIN function to return a text string containing all the elements in an array (String).
You can loop through the array using a For Next - Each loop.
Partial Match
This function uses a 1-dimensional array starting at 1.
Multi Dimensional - Partial Match
This function uses a 2-dimensional array starting at 1.
© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext