Hi ,
Use something like this :
=INDEX(Sheet1!K:K,SMALL(IF(Sheet1!B:B="P0227",ROW(Sheet1!B:B)),1))
entered as an array formula , using CTRL SHIFT ENTER.
I have not understood the part about field P62 on the main tab ; if it is just cell P62 on the main tab , then you can include it in the above formula as follows :
=INDEX(Sheet1!K:K,SMALL(IF(Sheet1!B:B="P0227",IF(Sheet1!B:B=main!P62,ROW(Sheet1!B:B))),1))
again entered as an array formula.
Use the $ signs as appropriate.
Narayan