View Single Post
  #3   Report Post  
tarquinious tarquinious is offline
Member
 
Posts: 31
Default

Quote:
Originally Posted by PuffyGrl82 View Post
Dear ExcelBanter community,

I have been stuck trying to figure out something I'm sure some of you experts would consider simple. I have an Excel worksheet where column C has the first names of a list of company employees. As an example, we may have cell C1 = "Debbie", C2 = "James", C3 = "Tony"...

What I need to do is figure out an equation where I can somehow get all these first names separated by a comma and a space. It would be great if I could get cell D1 = "Debbie, James, Tony, ...".

Any help would be appreciated. I've been trying to figure this out for the past week to no avail. Thank you!

- Vivian
Other than the CONCATENATE, you could also create a very simple Function.

To do this, go into VisualBasic and create a new Module. Copy and Paste in the following code:

Function JoinUp(CellRange)
For Each c In CellRange
NameList = NameList & c.Value & ", "
Next
NameList = Left(NameList, Len(NameList) - 2)
JoinUp = NameList
End Function

Back in your worksheet, type in the formula:
=JoinUp(C1:C3)

You can use this Function on any range of cells (in Rows or Columns) to join values into a comma-separated list.