Forum Discussion
IF conditional column not working in Sharepoint List.
Hi,
I am trying to create a new conditional column based on existing one. But i am getting syntex error in Sharepoint.
I have a Text column 'FC Month' on which i am applying conditional column.
Hi insandur
The issue you’re facing with the **syntax error** when trying to create a conditional column in SharePoint may be due to an incorrect formula structure or unsupported data types.
From the image, I see you’re working with a **text column ('FC Month')** and trying to create a conditional logic formula. If you are using functions like `IF` with a text-based comparison, the formula syntax needs to be adjusted.
### Some tips to resolve the issue:
1. **Ensure Proper Syntax**: In SharePoint formulas, the correct syntax for `IF` should look like:
```plaintext
=IF([FC Month]="01/01/2024", "TrueResult", "FalseResult")
```This assumes you're comparing text values, like dates formatted as text. If the date format is different, ensure that it exactly matches the text format you have in the 'FC Month' column.
2. **Quotes Around Text**: Since you're comparing text values, make sure that the values in the formula (e.g., dates like `"2024"`) are enclosed in **double quotes** (`" "`). This may be a reason for the syntax error you're encountering.
3. **Check Field Type**: If you're working with dates, it's important to ensure that your field type is properly configured. SharePoint might treat your text differently if it expects a different data type (like Date/Time instead of Text).
4. **Simplify the Formula**: Start with a simple `IF` condition to check the syntax:
```plaintext
=IF([FC Month]="2024", "Valid", "Invalid")
```This will help isolate whether the issue lies with a more complex formula or data comparison.
---
If these steps don’t resolve the issue, try to get assistance in the SharePoint community:
https://techcommunity.microsoft.com/t5/sharepoint/bd-p/SharePoint_General
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
1 Reply
- Ritaf1983
Super User
Hi insandur
The issue you’re facing with the **syntax error** when trying to create a conditional column in SharePoint may be due to an incorrect formula structure or unsupported data types.
From the image, I see you’re working with a **text column ('FC Month')** and trying to create a conditional logic formula. If you are using functions like `IF` with a text-based comparison, the formula syntax needs to be adjusted.
### Some tips to resolve the issue:
1. **Ensure Proper Syntax**: In SharePoint formulas, the correct syntax for `IF` should look like:
```plaintext
=IF([FC Month]="01/01/2024", "TrueResult", "FalseResult")
```This assumes you're comparing text values, like dates formatted as text. If the date format is different, ensure that it exactly matches the text format you have in the 'FC Month' column.
2. **Quotes Around Text**: Since you're comparing text values, make sure that the values in the formula (e.g., dates like `"2024"`) are enclosed in **double quotes** (`" "`). This may be a reason for the syntax error you're encountering.
3. **Check Field Type**: If you're working with dates, it's important to ensure that your field type is properly configured. SharePoint might treat your text differently if it expects a different data type (like Date/Time instead of Text).
4. **Simplify the Formula**: Start with a simple `IF` condition to check the syntax:
```plaintext
=IF([FC Month]="2024", "Valid", "Invalid")
```This will help isolate whether the issue lies with a more complex formula or data comparison.
---
If these steps don’t resolve the issue, try to get assistance in the SharePoint community:
https://techcommunity.microsoft.com/t5/sharepoint/bd-p/SharePoint_General
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly