Skip to main content
Solved

Remove duplicate in string and/or concatenate words

  • September 5, 2021
  • 2 replies
  • 85 views

See the attached screenshot for an idea of what I’m trying to accomplish. I’m using a formula to concatenate the names of sellers and buyers. Simple except that if there are two or more names, how can I remove the identical last name, or add an & between names if they are different names?

Best answer by Justin_Barrett

This can be done using a single rollup field. Roll up the last name based on the {Linked to Contacts}, and use this aggregation formula:

IF(values, "Seller to " & ARRAYJOIN(ARRAYUNIQUE(values), " & "))

The ARRAYUNIQUE() function gets rid of duplicate last names, ARRAYJOIN() joins them with the ampersand, and the rest adds the prefix as long as there’s one incoming name.

2 replies

Justin_Barrett
Forum|alt.badge.img+21
  • Inspiring
  • Answer
  • September 5, 2021

This can be done using a single rollup field. Roll up the last name based on the {Linked to Contacts}, and use this aggregation formula:

IF(values, "Seller to " & ARRAYJOIN(ARRAYUNIQUE(values), " & "))

The ARRAYUNIQUE() function gets rid of duplicate last names, ARRAYJOIN() joins them with the ampersand, and the rest adds the prefix as long as there’s one incoming name.


  • Author
  • New Participant
  • September 5, 2021

This can be done using a single rollup field. Roll up the last name based on the {Linked to Contacts}, and use this aggregation formula:

IF(values, "Seller to " & ARRAYJOIN(ARRAYUNIQUE(values), " & "))

The ARRAYUNIQUE() function gets rid of duplicate last names, ARRAYJOIN() joins them with the ampersand, and the rest adds the prefix as long as there’s one incoming name.


Thank you so very much. This works perfectly.