Hi all, I want to find the first cell that does not match a certain value.

For example I have this data:


First non
blank
value First non-
matching
value Column
Reference Data 1 Data 2 Data 3 Data 4 Data 5
AA AB 4 AA AA AB AA


The first 3 columns are the results. The rest of the columns are data. I have the following equation in Cell A2:

=INDEX(D5:FC5, MATCH("*", D5:I5, 0))

This returns the first non-blank text data and I use this as the reference value. The equation I require is for cell B2 which is to find the first non AA value. To makes matters more complex, the BLANK cells do not count as a change. So I guess the 2 questions are:

1. How to find the first cell that does not match the reference value, and
2. How do I ignore the blank cells to find the first non-match value.