2

No matter how simple I make my formula I always get an error when I try to save a new calculated column with an IF statement in it. For example:

=IF("Foobar"="Foobar", "Foo", "Bar")

On save I get "The formula contains a syntax error or is not supported"

BTW. I'm using Sharepoint in Office 365

  • It would seem that in Office 365 you have to use semi-colons instead of commas it totally right, after trying a lot of working examples that were not working I almost get crazy, then I saw this post to use semi-colons and now it is working thanx a lot – Cavit Nov 12 '18 at 17:54
7

Your formula is perfectly valid code

Language settings? Most non-english environments require a ; instead of ,

On English environments you can install a Bookmarklet to enhance the Calc editor

This blog might be of help too

  • Yip thanks, just posted the answer, but yours looks more complete. Marking as correct! – Jacques May 26 '16 at 16:32
  • Out of interest, our environment is set to South African English, so what would make this different? Or is it perhaps because we use a comma to separate decimals? – Jacques May 26 '16 at 16:34
  • If a comma is used to separate decimals, then it can not be used to separate parameters (as you would not be able to use decimals) , ergo the ; (semi-colon) is required. Same applies to formulas in Excel – Danny '365CSI' Engelman May 26 '16 at 19:01
0

Try

=IF(EXACT("Foobar", "Foobar"), "Foo", "Bar")
0

You need to try this.

=IF([ColumnName]="Foobar", "Foo", "Bar")
0

It would seem that in Office 365 you have to use semi-colons instead of commas. Here's the working formula:

=IF("Foobar"="Foobar";"Foo";"Bar")
  • It depends on your regional settings. – Amal Hashim May 26 '16 at 16:31
0

the formula should be like this:

=IF([Column]="<string>", "<string>", "<string>")

I tested your formula in my O365 tenant (copy pasted from your post) and it works with no issue. Can you please check if you mispelled something? the other thought is that the data type you are using is not a single line of text.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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