The array formula suggested above will work, absolutely. But if your dataset gets big that may start to bog down. Also, your sample indicated you wanted the customers concatenated into a single cell.
First, add this new function called ConcatIf() to your workbook.
1. Open up your workbook.
2. Get into VB Editor (Press Alt+F11)
3. Insert a new module (Insert > Module)
4. Copy and Paste in your code (given above)
5. Get out of VBA (Press Alt+Q)
6. Save your sheet.
Here's a sample book showing how it is used. It starts off exactly like a COUNTIF() formula.
=ConcatIf($A$2:$A$30,E2,$B$2:$B$30,", ",TRUE)
This is from the sample book attached which matches your sample data setup, in column F.
Bookmarks