Google Sheets – Fix Parse Error in IF Function

formulasgoogle sheetsworksheet-function

When I type this into the cell it gives me the parse error.

=if(B10>B2,"Win:" B10 (B10-B2) "SR",if(B10=B2,"Draw:" B10 "+0 SR","Lose:" B10 (B10-B2) "SR"))

B10 is 1489
B2 is 1510

I want the cell to say if I've "won" or not, and then the stats of the game
In this case, I want the cell to say "Lose: 1489 -21 SR"

What have I done wrong?

Best Answer

=IF( B10 > B2; "Win: "  & B10 & " +" & B10-B2 & " SR";
 IF( B10 < B2; "Lose: " & B10 & " "  & B10-B2 & " SR";
 IF( B10 = B2; "Draw: " & B10 & "+0 SR" )))

what went wrong:

parse error was generated because spreadsheet does not recognize these parts:

"Win:" B10 (B10-B2) "SR"
"Draw:" B10 "+0 SR"
"Lose:" B10 (B10-B2) "SR"

and its because there is missing character for appending which is: &
also its worth mentioning that empty space should be a part of appending text e.g. between " "

"Win: "&B10&" +"&B10-B2&" SR"
"Draw: "&B10&"+0 SR"
"Lose: "&B10&" "&B10-B2&" SR"

and then there is stacking with CTRL+ENTER for overal visual satisfaction, because 1-liner sucks

=IF(B10>B2; "Win: "&B10&" +"&B10-B2&" SR";
 IF(B10=B2; "Draw: "&B10&"+0 SR"; "Lose: "&B10&" "&B10-B2&" SR"))