Forum Discussion
Sharepoint list, Calculated Column, IF syntax error
- Sep 22, 2021
Dimitrij_P it needs to be =if([Column 1]="3","OK","NOK")
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
ChristinaGSPAdmin
Hi Christina,
have you tried the step Nr. 4 in my latest post:
Finally (especially in Sharepoint) I play around with "," ";", etc.
SharePoint can be sensitive to the use of commas and semicolons, especially if the environment is set to a language other than English (like German, Hindi, Bangla, Tamil, Marathi, Punjabi, etc.)
The formula you've used seems to be structured correctly, but let's review it for common issues in SharePoint calculated columns, particularly in SharePoint 2019.
Column Name Syntax:
- Make sure the column name [Choice Type] matches exactly as it appears in your list, including any spaces. SharePoint column names are sensitive to exact formatting.
Choice Column Values:
- Double-check that "Choice Type 1", "Choice Type 2", and "Choice Type 3" exactly match the options available in the "Choice Type" column. Even a small typo or extra space can cause the formula to fail.
Formula Validity:
- Sometimes, SharePoint can be a bit picky with the syntax, especially with OR conditions. You can try simplifying or testing one condition at a time to see if the formula evaluates correctly.
Data Type of Result:
- Ensure that the data type you selected for the result (in your case, "Single line of text") is compatible with what the formula returns.
Possible Debugging Steps
To isolate the issue, try the following simplified formula to test each condition individually:
=IF([Choice Type]="Choice Type 1","Optional","Not Optional")
If this works, add each condition back one at a time to identify where the problem might be occurring.
Reg.
Dimitrij
- UA-HandCraftsOct 28, 2024Copper Contributor
You can try this way:
=IF([Choice Type]="Choice Type 1","Optional",IF([Choice Type]="Choice Type 2","Optional",IF([Choice Type]="Choice Type 3","Optional","Not Optional")))RG
Dimitrij