Forum Discussion
Calculated column with check if column value contains a string
- Jan 29, 2024
AndreaPJ Are you getting the syntax error while using first formula you shared in your question? Or it is not returning correct results as expected.
Note:
- Sometimes comma( , ) does not work in formula (it is based on language or regional settings on your site). So in that case use semicolon( ; ) instead of comma( , ).
- Use correct display name of your SharePoint columns in above formula.
- Wrap column names inside [] if your column name has space in it. For example: [My Column Name].
If it is an issue due to comma, try using formula like:
=IF(ISERROR(FIND("CD";[Format]));"XX";"CD")
OR try using this once (with comma and with semicolon):
=IF(ISNUMBER(FIND("CD",[Format])),"CD","XX")
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
Since the SharePoint site is in Italian, I have to enter the equivalent formula in Italian; Maybe that's the problem?
Bye and thanks!
- ganeshsanapJan 31, 2024MVP
Small correction - SharePoint calculated column formula works with display name of columns and not internal names.
While, JSON formatting works with internal names and not display names.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- Eliot_ColeOct 24, 2024Iron ContributorIs this still true if you do not edit the validation formula after changing the name?
I am pretty sure that I've had success in getting my validation correct first, then renaming the column later.- ganeshsanapOct 24, 2024MVP
If you have added a list validation formula in the SharePoint list first AND then changed the display name of column later --> SharePoint automatically changes the list validation formula and uses new name of the column in the formula.
I just tested this in SharePoint Online list.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.