I am trying to make a list of serial numbers depending on the selection from the drop down list and put them onto different worksheets. If the first number selected is true how do i make the next formula move to the next step rather than display the next one.

Currently i am trying
In the fist cell
=if(b2=y12,a2,if(b3=y12,a3 and so on all the to b15
In the next cell
=if(b3=y12,a3 and so on all the to b15

how ever if the b2 is false i want it skips to the next one properly but i dont want the next cell to display the same answer i want it to move to the next one.

I hope i am making sense and someone can help.