I have a list of codes that are each assigned to a specific bigger case code and I would like to put a list all of the smaller codes that share one bigger case code in one cell. for example

D2-D6 are a 01 02 03 04 05 and C2-C3 is 1

  1. I want to group all the codes in the D column that share a 1 figure in the C column so the cell of my dreams would read "01,02". Any ideas on how to make this happen?

1 Answer 1


You can first FILTER your range so that you're just left with the rows that you want. This would look like this =FILTER(C2:D6, C2:C6 = 1). Then you'd need to somehow join the values in cells you've filtered. You could use TEXTJOIN for this =TEXTJOIN(",", TRUE, TO_TEXT(F6), TO_TEXT(F7)). I have cells from column F in my TEXTJOIN because that is where my filtered range went.

Note: I've tested my answer on Google Sheets but it is not clear from your question whether you are using Google Sheets or MS Excel.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.