Here is the formula that I tried to use:
IF((OR(LARGE(EF5:EF95,2)=EE184,LARGE(EF5:EF95,2)=EE188,LARGE(EF5:EF95,2)=EE189)),LARGE(EF5:EF95,3),(IF((OR(LARGE(EF5:EF95,3)=EE184,LARGE(EF5:EF95,3)=EE188,LARGE(EF5:EF95,3)=EE189),LARGE(EF5:EF95,4),LARGE(EF5:EF95,2)))

It didn't work....

What I am trying to say is:
IF EE185 (the second highest number in range EF5:EF95) is the same as EE184, EE188, or EE189 then EE185 needs to be the third highest number in range EF5:EF95.
IF EE185 is the same as EE184, EE188 or EE189 then EE185 needs to be the fourth highest number in range EF5:EF95

Any help?

Thank you!