Jan 29 2024 02:04 AM
Good morning to all,
I would like to create a calculated column where I go to check the content of an existing column (Format). The check I need to do is IF CONTAINS.
If the format column contains the word "CD", then my column will have a value of "CD", otherwise my column will have a value of "XX".
I've tried the formula
=IF(ISERROR(FIND("CD",[Format])),"XXX","CD") but it doesn't work.
I've also tried
=IF(NUM.IS(FIND("CD";[ Format]))); "CD";" XX"), but that doesn't work either.
Sharepoint goes into error.
What am I doing wrong?
Thanks in advance
Jan 29 2024 06:39 AM
@AndreaPJ the following works for me:
=IF(ISERROR(FIND("CD",Format)),"XX","CD")
Coincidentally, XX was on my first diplomatic license plate in Czechoslovakia in 1981. A few years later after promotion I qualified for a CD plate 🙂
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
Jan 29 2024 07:14 AM
Jan 29 2024 07:29 AM
Jan 29 2024 08:16 AM
Solution@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:
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.
Jan 31 2024 03:15 AM
Jan 31 2024 04:26 AM
@AndreaPJ Try calculated column formula like this:
=IF(ISERROR(FIND("CD";[Format]));IF(ISERROR(FIND("LP";[Format]));"XX";"LP");"CD")
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.
Jan 31 2024 04:29 AM
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.
Jan 31 2024 06:02 AM
Jan 29 2024 08:16 AM
Solution@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:
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.