Searching for multiple values in a range
Posted by Alan G on April 24, 2001 7:24 AM
I am looking for a way to find multiple entries of the same value in an array. For example, if I wanted to create a shoping list of items, I might use the the following data.
Column A Column B
Row 1 Apples yes
Row 2 Banannas no
Row 3 Peaches no
Row 4 Cherrys yes
Row 5 oranges yes
Row 6 grapefruit no
Row 7 strawberrys yes
In a separate sheet, I would like to compile the information as follows:
Column A
Row 1 Apples
Row 2 Cherrys
Row 3 oranges
Row 4 strawberrys
I can use MATCH to find 'yes' in column B, and use INDEX to record the item from Column A. Unfortunately, I can't use INDEX to search for the second location of 'yes', nor do I know how to change my range from b1:b7 to b2:b7 in order to grab the first 'yes' of a new location.
Is there a way to do this without sorting on column b or writing a macro?