See attached.
Added helper column in Blad2 with formula in J3:
=IF(AND(E3<>Blad1!$G$2,E2<>Blad1!$G$2,TRIM(E3)<>""),"",IF(OR(AND(TRIM(E2)="",E3=Blad1!$G$2),ISNUMBER(Blad2!J2)),COUNT(Blad2!$J$2:J2)+1,""))
copied down. This to tag the matching records to pull
Then in K3, formula to get count of records:
Then in Blad1 to get the records, in A8:
=IF(ROWS($A$1:$A1)>Blad2!$K$3,"",INDEX(Blad2!A:A,MATCH(ROWS($A$1:$A1),Blad2!$J:$J,0)))
copied down as far as you need and across the columns.
Format these columns as Custom: 0;-0;;@ to suppress the 0's for blanks retrieved.
Bookmarks