How to remove the unnecessary commas?

I worked out this formula with someone during a ProDesk session but they weren't sure how to remove the commas when they weren't needed so I'm hoping someone else maybe has an idea!
The formula:
=JOIN([Inspected Employee's Name 1]@row + ", " + [Inspected Employee's Name 2]@row + ", " + [Inspected Employee's Name 3]@row + ", " + [Inspected Employee's Name 4]@row + ", " + [Inspected Employee's Name 5]@row + [Inspected Employee's Name 6]@row + ", " + [Inspected Employee's Name 7]@row + ", " + [Inspected Employee's Name 8]@row + ", " + [Inspected Employee's Name 9]@row + ", " + [Inspected Employee's Name 10]@row + ", ")
Here's an example of what it looks like currently and I just don't know how to remove the extra commas without breaking the formula:
Best Answer
-
When you are dealing with non-adjacent columns, the best bet is to just "brute force" the formula. This should work as long as the employees are always filled in order.
=IF([Inspected Employee's Name 1]@row <> "", [Inspected Employee's Name 1]@row, "") + IF([Inspected Employee's Name 2]@row <> "", ", " + [Inspected Employee's Name 2]@row, "") + IF([Inspected Employee's Name 3]@row <> "", ", " + [Inspected Employee's Name 3]@row, "") + IF([Inspected Employee's Name 4]@row <> "", ", " + [Inspected Employee's Name 4]@row, "") + IF([Inspected Employee's Name 5]@row <> "", ", " + [Inspected Employee's Name 5]@row, "") + IF([Inspected Employee's Name 6]@row <> "", ", " + [Inspected Employee's Name 6]@row, "") + IF([Inspected Employee's Name 7]@row <> "", ", " + [Inspected Employee's Name 7]@row, "") + IF([Inspected Employee's Name 8]@row <> "", ", " + [Inspected Employee's Name 8]@row, "") + IF([Inspected Employee's Name 9]@row <> "", ", " + [Inspected Employee's Name 9]@row, "") + IF([Inspected Employee's Name 10]@row <> "", ", " + [Inspected Employee's Name 10]@row, "")
Answers
-
Hello @Ashley Klaers
Please try this:
=JOIN(COLLECT([Inspected Employee's Name 1]@row:[Inspected Employee's Name 10]@row, [Inspected Employee's Name 1]@row:[Inspected Employee's Name 10]@row, <> ""), ", ")
Hope this helps.
Che
-
That sort of worked! It helped with the comma issue but its also generating all of the information between 1 through 10:
-
Hello @Ashley Klaers
Just reference or adjust the column containing the employee names so it doesn't pick up all the information
=JOIN(COLLECT([Inspected Employee's Name 1]@row +... + [Inspected Employee's Name 10]@row, [Inspected Employee's Name 1]@row + ... + [Inspected Employee's Name 10]@row, <> ""), ", ")
Hope it helps
che
-
A bit closer, unless I'm still missing something or not fully understanding. Now the commas are gone altogether and there's no space between the names:
=JOIN(COLLECT([Inspected Employee's Name 1]@row + [Inspected Employee's Name 2]@row + [Inspected Employee's Name 3]@row + [Inspected Employee's Name 4]@row + [Inspected Employee's Name 5]@row + [Inspected Employee's Name 6]@row + [Inspected Employee's Name 7]@row + [Inspected Employee's Name 8]@row + [Inspected Employee's Name 9]@row + [Inspected Employee's Name 10]@row, [Inspected Employee's Name 1]@row + [Inspected Employee's Name 2]@row + [Inspected Employee's Name 3]@row + [Inspected Employee's Name 4]@row + [Inspected Employee's Name 5]@row + [Inspected Employee's Name 6]@row + [Inspected Employee's Name 7]@row + [Inspected Employee's Name 8]@row + [Inspected Employee's Name 9]@row + [Inspected Employee's Name 10]@row, <>""), ", ")
-
When you are dealing with non-adjacent columns, the best bet is to just "brute force" the formula. This should work as long as the employees are always filled in order.
=IF([Inspected Employee's Name 1]@row <> "", [Inspected Employee's Name 1]@row, "") + IF([Inspected Employee's Name 2]@row <> "", ", " + [Inspected Employee's Name 2]@row, "") + IF([Inspected Employee's Name 3]@row <> "", ", " + [Inspected Employee's Name 3]@row, "") + IF([Inspected Employee's Name 4]@row <> "", ", " + [Inspected Employee's Name 4]@row, "") + IF([Inspected Employee's Name 5]@row <> "", ", " + [Inspected Employee's Name 5]@row, "") + IF([Inspected Employee's Name 6]@row <> "", ", " + [Inspected Employee's Name 6]@row, "") + IF([Inspected Employee's Name 7]@row <> "", ", " + [Inspected Employee's Name 7]@row, "") + IF([Inspected Employee's Name 8]@row <> "", ", " + [Inspected Employee's Name 8]@row, "") + IF([Inspected Employee's Name 9]@row <> "", ", " + [Inspected Employee's Name 9]@row, "") + IF([Inspected Employee's Name 10]@row <> "", ", " + [Inspected Employee's Name 10]@row, "")
-
I was able to get it to work with that one fully, thanks Carson! :)
-
Happy to help!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.4K Get Help
- 465 Global Discussions
- 156 Industry Talk
- 510 Announcements
- 5.5K Ideas & Feature Requests
- 86 Brandfolder
- 156 Just for fun
- 81 Community Job Board
- 520 Show & Tell
- 35 Member Spotlight
- 3 SmartStories
- 307 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!