Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Search for a text string from one cell in another cell in Numbers

Hello,


I'm trying to find a formula for using the text string from one cell to search if that string is present in an other cell.


I need to make an overview of some software licenses, to see which one contains which options.


I hope you can help, as I have spent hours of trial and error.


Thanks

Posted on Jul 3, 2023 1:11 PM

Reply
8 replies

Jul 3, 2023 11:59 PM in response to MichTrol

Here's one way.


Formula in B4 is:


The formula is filled right to F4, then down to row 9.


The highlight colour fill was applied manually to highlight the cells returning a correct result of the formula, but a wrong answer to your original questions.



A small revision to the data entry (with no change to the formula) had these results:


Jul 4, 2023 12:49 AM in response to Badunit

Hi Badunit,


Thanks for your reply.


Actually, I could have been more precise;


The long text string with all information also contains a unique code for all options;

"Options: 201 A; 202 B; 203 c; 301 Max, 302 One..." So would that be more useful to look for? Either the number code or the entire string of code and name, e.g. "203 c"


Will try today.


Jul 3, 2023 9:44 PM in response to MichTrol

While it is simple to find if the letter "A" is in the string "A, B, C, max, one", there are nuances to it.


=COUNTMATCHES(B2,$A4)>0

This will look for the letter "A" anywhere in the string, case insensitive. There are two of them, the single letter "A" and the "a" in "max". Either one will return TRUE. This is probably not the answer you want.


=IFERROR(FIND($A4,B2)>0,FALSE)

This will look for "A", case sensitive. If cell B2 had "Alpha" as an option, it would return true even if there was not a standalone "A" in the list. Also probably not the answer you want.


=COUNTMATCHES(B2,REGEX("(^|, )"&$A4&"(, |$)",FALSE))>0

This complicated looking thing looks for "A" as being the entire string, "A, " at the beginning of the string, ", A, " somewhere in the middle, or ", A" at the end. It is case sensitive but can be made case sensitive. It requires each option in the list to all be followed by a comma and a space, except for the last one. An extraneous comma or misplaced or missing space could cause a problem. An option in the list can have a space in it like "max audio" and you can search for that term.



Search for a text string from one cell in another cell in Numbers

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.