Spreadsheet: 270113d1381386056-help-with-a-formula-to-find-the-nth-occurrence-nth-occurrence
Sheet: Sheet1

Bull Trend |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | X or Y |  |  |  |  |  |  |  | Z
# | # | 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 |  |  | 1st Instance Were All of the "X"s Are True |  |  | 2nd Instance |  |  | 3rd Instance |  |  | 4th Instance |  |  | 5th 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 | <---- | This is what the final result should be. |  | <---- | This is what the final result should be. | C | <---- | This is what the final result should be. | D | <---- | This is what the final result should be. | F | <---- | This is what the final result should be. | G | <---- | This is what the final result should be. | H | <---- | This is what the final result should be.
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 |  |  |  |  |  |  |  |  |  | <---The formula that finds the 1st instance | D | <---- | This is what the final result should be. | H | <---- | This is what the final result should be. | C | <---- | This is what the final result should be. | D | <---- | This is what the final result should be. | F | <---- | This is what the final result should be. | G | <---- | This is what the final result should be. | H | <---- | This is what the final result should be.
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 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | C | <---- | This is what the final result should be. | D | <---- | This is what the final result should be. | F | <---- | This is what the final result should be. | G | <---- | This is what the final result should be. | H | <---- | This is what the final result should be.
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 |  |  |  |  |  |  |  |  |  | <---The formula that finds the 1st instance | G | <---- | This is what the final result should be. | H | <---- | This is what the final result should be. | C | <---- | This is what the final result should be. | D | <---- | This is what the final result should be. | F | <---- | This is what the final result should be. | G | <---- | This is what the final result should be. | H | <---- | This is what the final result should be.
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 |  |  |  |  |  |  |  |  |  | <---The formula that finds the 1st instance | H | <---- | This is what the final result should be. |  | <---- | This is what the final result should be. | C | <---- | This is what the final result should be. | D | <---- | This is what the final result should be. | F | <---- | This is what the final result should be. | G | <---- | This is what the final result should be. | H | <---- | This is what the final result should be.
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 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | C | <---- | This is what the final result should be. | D | <---- | This is what the final result should be. | F | <---- | This is what the final result should be. | G | <---- | This is what the final result should be. | H | <---- | This is what the final result should be.
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 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | C | <---- | This is what the final result should be. | D | <---- | This is what the final result should be. | F | <---- | This is what the final result should be. | G | <---- | This is what the final result should be. | H | <---- | This is what the final result should be.
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 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | C | <---- | This is what the final result should be. | D | <---- | This is what the final result should be. | F | <---- | This is what the final result should be. | G | <---- | This is what the final result should be. | H | <---- | This is what the final result should be.
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 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | C | <---- | This is what the final result should be. | D | <---- | This is what the final result should be. | F | <---- | This is what the final result should be. | G | <---- | This is what the final result should be. | H | <---- | This is what the final result should be.
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 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | C | <---- | This is what the final result should be. | D | <---- | This is what the final result should be. | F | <---- | This is what the final result should be. | G | <---- | This is what the final result should be. | H | <---- | This is what the final result should be.
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 |  |  |  |  |  |  |  |  |  | <---The formula that finds the 1st instance | H | <---- | This is what the final result should be. |  | <---- | This is what the final result should be. | C | <---- | This is what the final result should be. | D | <---- | This is what the final result should be. | F | <---- | This is what the final result should be. | G | <---- | This is what the final result should be. | H | <---- | This is what the final result should be.
Column (AB) looks for all the rows where X or Y are False but all Z's are true and the result is the column heading.
It uses columns "T - Z" to make this determination.
Column (J) looks all of the instances were all of the rows with X in them are true and the result is the column heading.
The 1st column looks for the 1st instance that pertains to that row, the 2nd column the 2nd instance, and 3rd the column the 3rd insance et.c for however many instances I need.