In my last post I showed you how to find a sequence of values. The array formula extracted the row of the first found sequence, see below.
Array formula in cell F3:
What I didn´t show you was how to find multiple sequences with this particular array formula.
This array formula finds all instances of a sequence. It returns their starting row number.
Array formula in cell F8:
Look for a multi-level sequence
The next array formula looks for a values in both columns and rows. The picture explains it all.
Array formula in cell H3:
Use this formula if you are looking for the first instance of a sequence. It looks for a specific sequence (LexCorp and Paradise Airlines) in column A and for 604 and 767 in column B. LexCorp and 604 must be on the same row and Paradise Airlines and 767 must be on the next row below.
This formula is quite small, if you compare it to the following formula.
Look for multiple multi-level sequences
Array formula in cell H8:
It is like the formula above but it returns the location of multiple sequences.
Wild card search for a sequence
This demonstrates how to do a wild card search for a sequence. This formula returns the row number of first found sequence in column A. The formula looks for a text string in a cell and another text string in the cell below. You don´t need to enter the wild cards * (asterisks), see cell F3 and F4.
Wild card search for multiple sequences
This demonstrates how to do wild card searches for multiple sequences. This formula returns the row number of all found sequences in column A. The sequence is in cell F11 and F12.
Array formula in cell G11:
If a cell contains "Corp" and the next cell beneath contains "Airlines" the array formula returns the row number.
If you want to learn more about array formulas join Advanced excel course.
Functions in this post:
Returns the k-th smallest number in this data set.
COUNTIFS(criteria_range1,criteria1, criteria_range2, criteria2...)
Counts the number of cells specified by a given set of conditions or criteria.
Returns the starting position of one text string within another text string. FIND is case-sensitive.