Can't put ifandif in formula

Hope I can explain this without being too confusing!

I have a formula that works in ms excel but gets a #value! error, when there are 2 IF checks together.
What I’m trying to do is pick the top ranking scores in male female categories.

Here is a copy of my formula that works, except it does not select whether or not the person is male or female.
=IF(A37="","",INDEX($‘par équipe’.$B$2:$B$101,SMALL(IF($‘par équipe’.$C$2:$C$101=B37,ROW($‘par équipe’.$C$2:$C$101)-ROW($‘par équipe’.$C$2)+1),COUNTIF($B$7:B37,B37))))

This formula gives an error
=IF(A43="","",INDEX($‘par équipe’.$B$2:$B$101,SMALL(IF(IF($‘par équipe’.$A$2:$A$101=“m”,$‘par équipe’.$C$2:$C$101=B43),ROW($‘par équipe’.$C$2:$C$101)-ROW($‘par équipe’.$C$2)+1),COUNTIF($B$7:B43,B43))))

This is what it looks like in ms excel 2007
=IF(A37="","",INDEX(‘par équipe’!$B$2:$B$101,SMALL(IF(IF(‘par équipe’!$A$2:$A$101=“m”,‘par équipe’!$C$2:$C$101=B37),ROW(‘par équipe’!$C$2:$C$101)-ROW(‘par équipe’!$C$2)+1),COUNTIF($B$7:B37,B37))))

Hope you can help!!!
Ranger801

Are you introducing the formula as array, [Ctrl+Shift+Enter] instead only [Enter]

Yes, I am entering Ctrl+Shift+Enter

Please can you share a file sample?

I’m new to this, how do I provide the formula?

I have upvoted your question, so you can edit it and attach sample file.