Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Display cells that contain X in excel

No idea how to title this one.

enter image description here

Suppose I have the above table. I want the column "used in" to display the name of every food that uses the food on this row, to look like this:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

The separator is unimportant, I just used a ; as I like how it looks. How would I go about this?

>Solution :

Try the following formula:

enter image description here


• Formula used in cell B3

=TEXTJOIN(";",,FILTER(A$3:A$6,1-ISERR(SEARCH(A3,C$3:C$6)),"-"))

Or Using one single dynamic array formula called BYROW() passing a custom LAMBDA() calculations. Do note one vital point, that TEXTJOIN() function has character limitations hence using the fill down approach is more appropriate in this scenario, however, if its within the limit you could try this as well:

enter image description here


=LET(
     _food, A3:A6,
     BYROW(A3:A6,LAMBDA(x,TEXTJOIN(";",,
     FILTER(_food,ISNUMBER(SEARCH(x,C3:C6)),"-")))))

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading