Hi,
I am looking for a function (or a combination of them) that will check if 1 id in string is contained in another.
For example: ‘13,24,35’ , ‘24,47,67’ will return TRUE because 24 shows up in both the first string and the second.
Is there a way to achieve this?
Hello @Shir24589 ,
Welcome to the monday community!
Unfortunately, I do not think this is possible, at least dynamically. You might be able to check a specific ID though (24 for example).
Let me know if I can help more.
Best,
Giannis, Implementation Consultant at thespelas.com
Hi Shir,
If you know the Id that you are looking for, yes.
If your 2 strings of Ids are in {Text} and {Text 1}, here is how you would do it.
If you want to know if 24 is in {Text}, you compare the length of {Text} with the length of {Text} once 24 has been removed. If both lengths are equal, then it means 24 is not in there.
LEN({Text})-LEN(SUBSTITUTE({Text},"24","")
So you check if 24 is in both and return True or False depending on the case.
IF(AND(LEN({Text})-LEN(SUBSTITUTE({Text},"24",""))>0,LEN({Text 1})-LEN(SUBSTITUTE({Text 1},"24",""))>0), True, False)
Now, this would be more complicated if your ids could have more than 2 digits, because 24 could be found in 240 but you get the idea.
If you don’t know the Id and want to check if any id is in both, do you at least know how many ids are in each string of Ids?
Looking for a simpler way to write complex formulas? Check out the Advanced Formula Booster at https://mdboosters.com. It’s a convenient third-party app that simplifies formula writing. With it, you can spread your formulas across several lines, utilize variables, and access dozens of functions not found in the standard formula column.
Thank you for your comment! unfortunately my ids are longer than 2 digits.
Basically I have 1 column of type person, and the second column of type person.
I wanted to find a way to write a formula field that will check if a person from column A also appears in column B.
So I thought to use the ids, but I can also use names which can give me the solution with the LEN function you proposed (since the team is small and there are not 2 people with the same full name)