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

Return Multiple Column Names from a table in one cell where value is present

I have an excel table where I calculate the total number of machine parts required in a large-scale manufacturing operation. Each row represent a different machine parts and each column after some description of the machine part represents a machine number. The same machine part may or may not be used in multiple machine numbers. I have a "Machine Numbers" column where I would like to return all the Column Names where a value is present. As in, if that machine part is required in the Machine Numbers MN1, MN3 and MN10, it should return "MN1, MN3, MN10". I have posted the table image below for further clarification with some example answers on the red column:

Example

I have done it manually. What formula should I write so that the Machine Numbers column fills up automatically? Please note that this is a TABLE. Let’s assume the table name is "MP". I also use Excel 265.

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

>Solution :

You can use this formula:

=TEXTJOIN(", ",TRUE, FILTER(MP[[#Headers],[MN1]:[MN5]],MP[@[MN1]:[MN5]]<>""))

The FILTER selects all column headers where there are – per row – values (using Implicit intersection operator @

TEXTJOIN combines the result to a string.

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