G2 input
=index(a:a,small(if(left($b$2:$b$ 1000)="c",row($2:$ 1000),4^8),row(a 1)))&; ""
For array formula, hold down CTRL+SHIFT first, and then press ENTER.
Formula right drop-down menu