I have a list of numbers in column A with corresponding categories in column B. Some of the categories in column B repeat. In column C, I have a list of all the unique values which appear, in order, in column B. What I need to do is create a comma separated list in Column D of all the numbers in column A which have the same unique value in column B. For example:

A B C D
1 E E 1, 4
2 G G 2
3 F F 3, 5
4 E
5 F

Just to reiterate, I already have colums A, B and C figured out. I only need help making the comma separated list in column D. Also, it needs to be an equation, nothing in visual basic or using a macro. I was thinking some sort of modified VLOOKUP function?

Thanks for your help!!