1

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?

1 Answer 1

1
=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"))
6
  • It's not clear how this answer the question. It's worth to note that the OP is using commas as parameter separator but the formula on this answer use semicolon. Jul 8, 2018 at 19:33
  • @Rubén not sure what do you mean by "it's not clear how this answer the question". OP uses USA syntax, so semicolon will be autoconverted into commas. apart of that, there isnt much to talk about. OP clearly missing a lot of stuff in his/her formula approach, so basic visual self-comparsion should be more than sufficient
    – user0
    Jul 8, 2018 at 19:50
  • "Obviously" for the OP it's not clear the missing parts otherwise they will not post a question, I think. We could say that the assumption that doing basic visual self-comparison was sufficient is true for the OP as they already accepted this answer but I don't think that this will be true for other readers, but we will not be certain of that specially for those who can't comment or vote. Jul 8, 2018 at 20:07
  • From my point of view a good answer that includes a formula or code line should include a brief description of how that answer the question. Jul 8, 2018 at 20:09
  • 1
    @Rubén I dare to disagree. too much information can cause distraction and hence destroy curiosity of learning. I added "what went wrong" part, but it didnt make me happy :)
    – user0
    Jul 8, 2018 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.