r/excel • u/PocketSandPolicy • Jun 12 '26
Waiting on OP Concatenate varying number of columns with static value

What I'm trying to accomplish:
Referring to the image and data under Original Example I want to combine each of the IDs in Column A, a delimiter (-), and each of the colors in a single column as the example in Column A rows 13-24.
Row count averages in the low 100s but I'm repeating the action regularly across multiple files. Because the number of colors is highly variable textjoin after text-to-columns isnt giving me the results I want as it only looks for the first value to be blank. Formula showing is from red box. Orange highlights are the results I dont want.
If there is already a name for this method I am unaware of it/what to research.
•
u/AutoModerator Jun 12 '26
/u/PocketSandPolicy - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/PocketSandPolicy Jun 16 '26
Thank you to those who provided possible solutions. I should've clarified that I am using 2021 and ultimately Chat GPT provided a workable solution using Power Query. However the contributions below did help me focus my search.
4
u/PaulieThePolarBear 1929 Jun 12 '26 edited Jun 13 '26
With Excel 2024, Excel 365, or Excel online, you can use one of below
Note that the last option will be limited to 32,767 characters in both instances of TEXTJOIN
Edit: and a fourth option merging options 1 and 3
Same limitations as before in regard to TEXTJOIN
4
u/excelevator 3071 Jun 12 '26
Always a tricky one with
TEXTSPLITthat does not allow an array of arrays processing.A shortcut is to join the text as a single string and then split
=LET(D,TOCOL(IFERROR(A3:A6&" - "&TEXTSPLIT(TEXTJOIN(";",,C3:C6),",",";"),"")),FILTER(D,D<>""))3
u/MayukhBhattacharya 1327 Jun 13 '26 edited Jun 13 '26
Here are few alternative methods, you could try:
• Method One - MS365 Exclusive:
• Method Two - MS365 Exclusive:
• Method Three - Power Query:
• Method Four - And just for fun, Python In Excel through Anaconda:
2
u/CorndoggerYYC 162 Jun 13 '26
Power Query solution.
2
u/plu6ka 2 Jun 13 '26
yet another power query solution
2
u/GregHullender 195 Jun 13 '26
This is fairly compact, and it works with lists of any size:
The complicated expression on the second line does what you wish TEXTSPLIT did, with error values for the short lines. E.g.:
The last line just concatenates your IDs and "-" in front of each of these, and returns a blank for the error values.
1
u/Decronym Jun 13 '26 edited Jun 13 '26
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
|-------|---------|---| |||
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
[Thread #48716 for this sub, first seen 13th Jun 2026, 00:08] [FAQ] [Full list] ^[Contact] [Source code]
1
u/sethkirk26 29 Jun 13 '26
I think i thought of a simpler method. For each string of colors, could you use substitute, to substitute "," with ","&[NumberCell]&"-" Then just spilt string after that. You would need to add an extra comma at the beginning, but that's easy.
1
u/[deleted] Jun 13 '26
[removed] — view removed comment