Simple formula question

I am using calc for a simple spreadsheet. I have been away from the world of spreadsheets for a long while. I am trying to enter an “if function” that evaluates a cell containing a text character:

edit by @karolus : put Formula into ``````backtics

This function does not work. When I hit the enter key I do not get a result: the resulting cell only outputs the function text: =IF(F6="c",10,20). If I replace the condition with a number, say 3, the function will output the correct condition (in this case, 20). Can anyone help?

Your formula is displaying typographic quotes, they don’t work in formulas. If you start entering a formula in Calc with = you won’t get typographic quotes.
If you copy from, say Writer, it might have automatically changed the standard quotes (").
You can turn off typographic quotes in Tools > AutoCorrect options > Localised Options and untick double quotes, and single if wanted too.

the original Formula is ok, it needs only to be quoted in ``````backtics

How did you do that? Just typing?

For me this starts with a formula copied from a text formatted cell and pasted special (Ctrl+Shift+V) with the default setting in a number formatted cell (only @user_three could tell).
If this is so, edit the cell content (F2), add and delete a space, and press Enter (or select the cell and choose menu Data - Text to Columns… - OK).

When this happen, just edit the question, and copy the formula in edit mode. And since you are there, press Ctrl+Shift+C to convert the formula to preformatted text, this will put the grave accent around the selected text.

EDIT after next @EarnestAl comment: Excuse me for having sounded a bit rude. My comment was not intended agaist anyone, and much less against you, although I quoted from your first comment to put the context to my own.

Quotes (“a”), if not preformated ("a"), are (and will be) a problem here, especially to newcomers, because they (quotes) are not seen as typographic in edit mode.
By the way, just discovered that between parentheses (""), and without text/number content, they behave different.

I feel a need to defend my comment from criticism and alteration by others.
I was looking at the described symptoms and the 3 substitution; my comment fits all of them, except that the OP said the cell output the formula. But was that in the formula bar? Maybe the cell itself displayed Err: 501?
It was a comment, not a solution only because of that question. It might not be right, but unless there is a better solution that fits all the criteria please just ignore my comment.

This answered my question.

@user_three : Switch off
→→View→→Show Formula
and use ;semicolon instead ,comma

So it can only be in quotes.

1 Like

there no typografic quotes in the original formula, for me I need to replace comma with semicolon

No, because for the questioner this example works with a comma. Somewhere @mikekaganski wrote that US users use a comma as a parameter separator, and Calc understands it.

True, the meaning is slightly different: you can use a semicolon, even if the separator is a comma.