Home > Software engineering >  Get multiple values in a single cell with array formula
Get multiple values in a single cell with array formula

Time:11-10

I'm trying to get an array formula to get the multiple results in a single cell. Is that possible?

For example below, I'd like to show in D2 all the names in column B corresponding to rows for values less than 4 in column A.

enter image description here

My current attempt below:

A   C
2   Jane
3   John
6   Thomas
1   Michael
2   Mary
7   Jason
3   Gloria
1   Andrea


=CONCAT(INDEX($B$2:$B$9,IF($A$2:$A$9<4,$B$2:$B$9)))

My desired result would be:

Jane, Michael, Mary, Andrea

CodePudding user response:

You need FILTER() then TEXTJOIN().

=TEXTJOIN(", ",TRUE,FILTER(B2:B9,A2:A9<4))

enter image description here

  • Related