Spreadsheet: 270847d1381709480-help-with-a-formula-to-find-the-nth-occurrence-nth-occurrence-example1
Sheet: Example 1

Bull Trend
# | # | Date | Time | Open | High | Low | Close | Vol | Mark | P/L | A | B | C | D | E | F | G | H | 0 | 1 | 2 | 3 | 4 | 5 | 6 |  | 1st Instance |  | 2nd Instance |  | 3rd Instance
3884 | 41 | 2001-01-02 00:00:00 | 00:45:00 | 0.9455 | 0.9468 | 0.9452 | 0.9458 | 60 | X | Loss | True | False | True | True | False | True | False | False |  |  |  |  |  |  |  | <--- Helper Columns |  | <---The formula that finds the 1st instance | H | <---The formula that finds the 2nd instance |  | <---The formula that finds the 3rd instance
7233 | 76 | 2001-02-19 00:00:00 | 22:00:00 | 0.924 | 0.924 | 0.9232 | 0.9235 | 60 | Y | Break Even | True | False | False | False | True | True | True | False |  |  |  |  |  |  |  |  |  |  | D |  | H
10235 | 107 | 2001-04-04 00:00:00 | 04:30:00 | 0.9009 | 0.9028 | 0.9004 | 0.9022 | 60 | Z | Profit | True | False | True | True | False | True | True | True
13194 | 138 | 2001-05-17 00:00:00 | 00:15:00 | 0.8843 | 0.8863 | 0.8839 | 0.8862 | 60 | X | Loss | True | False | True | True | False | False | False | False |  |  |  |  |  |  |  |  |  |  | G |  | H
15225 | 159 | 2001-06-15 00:00:00 | 04:00:00 | 0.866 | 0.8671 | 0.8654 | 0.8664 | 60 | X | Loss | True | False | False | True | False | True | True | False |  |  |  |  |  |  |  |  |  |  | H
27792 | 290 | 2001-12-17 00:00:00 | 01:45:00 | 0.9039 | 0.9067 | 0.9036 | 0.9061 | 60 | Z | Profit | True | False | True | True | False | True | True | True
31609 | 330 | 2002-02-12 00:00:00 | 00:00:00 | 0.8777 | 0.8792 | 0.8775 | 0.8782 | 60 | Z | Profit | True | False | True | True | False | True | True | True
36601 | 382 | 2002-04-25 00:00:00 | 00:00:00 | 0.8936 | 0.8945 | 0.8926 | 0.8943 | 60 | Z | Profit | True | False | True | True | False | True | True | True
38914 | 406 | 2002-05-29 00:00:00 | 02:15:00 | 0.9292 | 0.9311 | 0.9292 | 0.9306 | 60 | Z | Profit | False | True | True | True | False | True | True | True
39025 | 407 | 2002-05-30 00:00:00 | 06:00:00 | 0.9377 | 0.9385 | 0.9371 | 0.9382 | 60 | Z | Profit | True | False | True | True | False | True | True | True
51793 | 540 | 2002-12-03 00:00:00 | 06:00:00 | 0.9967 | 0.9993 | 0.9964 | 0.999 | 60 | X | Loss | False | True | False | True | False | True | True | False |  |  |  |  |  |  |  |  |  |  | H
Below is what the formula in column "AB" does using the helper columns "T - Z".
Column "J" contains X's, Y's, and Z's. The formula would work this way:
Breakdown:
1.) The formula would determine if there is an X, Y, or Z in the cell of column “J”, heading “[NAME]”, in the row where the formula is located.
2.) If so, the formula would start with the column “L”, heading 1, and compare the true/false results of X or Y cells in column 1 to see if they are different from all of the results that equal Z in the same column.
3.) The first instance/column found where the result is false for the X or Y but true for Z then the number of that column will be the final result.
Example
1.) The formula would find the X in column “J” row 2 and then proceed to find all instances of Z below it and above it in column “J” as well.
2.) After locating all instances of Z in column “J” it would then search through columns “L – T” for all instances were X (i.e.J2) were false and Z (i.e.J14) were true.
3.) After finding the first instance of such it would then enter the heading of the column were it took place which is column “T” thus the answer would be "9".
4.) For all cells in column “J” that don’t contain an X or Y I want the result to be “None”. For all cells in column “J” that have a Z I want the result to be Z.
What I Now Need the Formula to Do
I need column "AB" to look for the 1st instance with the result being the column heading when all requirments are met, "AD" to look for the 2nd instance, "AF" the 3rd instance etc.
Thank you again for taking the time to review my spreadsheet and assisting me with creating a formula that provides me with my desired result.