Try in G2:
=IFERROR(INDEX($A$2:$A$10,SMALL(IF($B$2:$B$10="Dog",IF(ISNA($E$2:$E$10),ROW($B$2:$B$10)-MIN(ROW($B$2:$B$10))+1,""),""),ROW(1:1))),"")
H2:
=IFERROR(INDEX(C$2:C$10,SMALL(IF($B$2:$B$10="Dog",IF(ISNA($E$2:$E$10),ROW($B$2:$B$10)-MIN(ROW($B$2:$B$10))+1,""),""),ROW(1:1))),"")
Both confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
Drag H2 to I2
Drag G2:I2 down
Bookmarks