Help with IF function of excel

psaila

Member
As the worldcup is coming I am trying to do a spread sheet in which I insert the result of a game and the spreadsheet calculates whether it is 1,X, or 2. I managed to do this however the problem is that when the cells are still empty because the game has not been played yet it is considering it as a draw and prints X in the cell. Could you tell me how to arrange my formula pls?.

=IF(F2=H2,"X",IF(F2>H2,1,IF(F2<H2,2,0)))
 
I'm not sure if this is the most economical way to do it, but it works.

=IF(AND(F2="",H2=""),"",IF(F2=H2,"X",IF(F2>H2,1,2)))

Note the last "else" defaults to "2" since the only choice left is F2<H2.
 
Back
Top