Good morning all,
I have a tricky situation I am trying to solve with a nested IF OR AND function.

In Column A I have names, Columns B and C have input values. In column D I require my function. Example as follows.

Mark - 1 - 4
John - 3 - 2
Mary - 1 - 0
Susan - 2 - 5
Andrew - 1 - 1
Joan - 3 - 3

My answer in Column D must only use the male names, and calculate an answer based on the difference between B & C.
If B<C then 0, if B=C then 1, if B>C then 2

So the output would look like this:
Mark - 1 - 4 - 0
John - 3 - 2 - 2
Mary - 1 - 0 - 0 (or blank)
Susan - 2 - 5
Andrew - 1 - 1 - 1
Joan - 3 - 3

Also included is if no values are in B, leave D blank.

I have got this so far in column D, but it is not working too well ...

IF(B2="","",IF(OR(A2="MARK",A2="JOHN",A2="ANDREW"),AND(B2>C2)*2,IF(B2=C2,1,0)))

Am I going about this the correct way, or what is it that I am missing?
Any help is much obliged. My first day here, so I am hoping that this forum is as awesome as it looks!
Thanks,
HGL