Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Merge ?

Status
Not open for further replies.

Rob7412

Technical User
Jan 26, 2006
31
US
I have a colum "A" that list a group number for a user and I have another column that list the lastname of a user. What I want to do is for evryone that is in the same group merge all the last names into another field Is this possible?

Example:
GroupID Lastname Merged field
1 smith
1 green
smithgreen

2 brown
2 white
2 blue brownwhiteblue

If Knowledge were power I would be a AAA Battery!
 
If you download the Morefunc add-in, free from Laurent Longre:


you'll have access to a function called MCONCAT, which you could use in a formula to do what you want.

An example of the type of thing you might want could be:
Code:
=IF(A2="",IF(B1="","",MCONCAT(OFFSET(B2,-COUNTIF($A$2:$A$99,A1),0,COUNTIF($A$2:$A$99,A1),1))),"")

This uses the COUNTIF and OFFSET functions to calculate the range to feed into the MCONCAT function.

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top