alex
alex

Reputation: 45

Comparing Cells with IF Statement with 3rd Outcome

I'm making a Rugby Predictor spreadsheet for a specific game my friend created. Take the following example:

Wales 35 Italy 10

So in this game, if you predict the winner you get 2 points.

However, you can predict a Draw which would get you 3 points.

I have outputted the winner of the above game into a field in itself, for arguments sake, lets say it's in the cell G5.

I'm trying to compare the cells containing people predictions to give you points. Lets say the persons prediction is in the cell C10.

Below is my attempt at the code, which works for a Draw predicition.

=IF(AND(C10="Draw",G$5="Draw"),"3", IF(C10=G$5, "2", "0"))

However, the logic should be:

IF Prediction is correct output 2, IF Prediction is wrong output 0, IF Prediction = "Draw" AND correct output 3

Can someone help me with the logic in Excel? Please let me know if you need further clarity.

Upvotes: 0

Views: 36

Answers (1)

K753
K753

Reputation: 388

This should work:

=IF(G$5="Draw",IF(C10=G$5,3,0),IF(C10=G$5,2,0))

It first checks if the outcome is a draw, if true then it checks if the prediction is correct and equals 3 if true. If the outcome is not a draw it will perform the same check but only equal 2 if true. In both cases if the prediction is not correct it will equal zero.

Upvotes: 1

Related Questions