Here are two different ways you can do it.
1.) Use a "helper" column in column D with this formula
Formula:
=IF(AND(B2="P",C2>145),ROWS($2:2))
Then enter this formula in A13, fill down and across until you get blanks.
Formula:
=IFERROR(INDEX(A$2:A$7,SMALL($D$2:$D$7,ROWS($13:13))),"")
2.) Or if you prefer to not use a helper column array enter this formula, fill down and across until you get blanks. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
Formula:
=IFERROR(INDEX(A$2:A$7,SMALL(IF(($B$2:$B$7="P")*($C$2:$C$7>145),ROW($A$2:$A$7)-ROW($A$2)+1),ROWS($13:13))),"")
Bookmarks