Hello,
I'm using LOOKUP to do something simple, but it appears to be giving a wrong (or I should say, at least unexpected) result some of the time.
I have a simple table where row 1 has four names in cols A through D (say "First", "Second", "Third", and "Fourth"). In rows 2 through 16, I have placed an "X" in one or more of the cells in each row. I followed a binary pattern to account for all combinations of X. For example row 2 has blank,blank,blank,X. Row 12 has X,blank,X,X. Row 16 has X,X,X,X.
In col E, for each row 2 through 16, I have the following formula:
=LOOKUP("X",A2:D2,$A$1:$D$1)
Every row in col E gives me the right answer except for two:
row 6 (blank,X,blank,X) gives me "Second" where I expected "Fourth".
row 14 (X,X,blank,X) gives me "Second" where I expected "Fourth".
I don't understand this as there are other rows with blanks in col C, yet it returns what I expect. For example:
row 10 (X,blank,blank,X) gives the expected value of "Fourth".
I tried this with MATCH too, and those same two locations give me the same unexpected index.
Can someone please explain this? I just want to get the col value in the first row that corresponds to the last "X" in each row.
Thanks, and sorry this description is so long. Harder to explain than to just look at!
Tony
Bookmarks