This is doable using just formulas. I just did this for a Cub Scout packs Pinewood derby where you dont know the order the kids check in but need to break them apart quickly into their grade levels (or ranks).
I cant do it in numbers from where i am (I only have excel at hand), but the basic formula looks like this for the first cell, in a hidden column, shows the row number of the first cell with a YES in it. (this cell is in my cell F1 btw)
=MATCH("Yes",$C$1:$C$8,0)
Followed in the cells below with:
=IFERROR(MATCH("Yes",OFFSET(C1,F1,0,10,1),0)+F1,"")
So we find the next match, add the offset of the last row and that gives the second row Yes was found on
then in my column G I use offset to move from a known point, using the row offset to tell the formula what text to grab.
=OFFSET($B$1,F1-1,0,1,1)
you subtract one because you dont want to -offset- the number of rows, but offset TO that row.
Hope you can see what I was doing here. If not maybe someone that has numbers at hand and can do some screenshots can help us both out.
Jason