Looking to Concenate a series of numbers for an xml api url

solved

I am trying to use an xml api that only requires me to adjust the number at the end of the url, and I have about 50 numbers set up in a column. I need the take the url then concatenate a number and a comma after the first number, and then the second number, and another comma, and so on. However if there is a comma at the end of the url the api will not recognize it as anything. Is there a way to chain these numbers together into the string I need? I have previously been working mostly in google sheets, but I moved over to excel to see if it would be easier, but if you have a solution that would work in sheets I would take that as well.

Posted Dec 25, 2017, 11:14 PM UTC

27
excelevator942•

If you have Excel 2016 365 then you could use TEXTJOIN

If not then use this TEXTJOIN UDF

2
TheCrypticFoxOP•

This is precisely what I was looking for, did not know that function exist. Thank you.

1
excelevator942•

Cool, please set your question flair to Solved, or reply to this comment with Solution Verified to set it automatically by our bot.

3
TheCrypticFoxOP•

Solution verified

2
Clippy_Office_AsstMOD•

You have awarded 1 point to excelevator

1
sqylogin292•

Do you have a few samples?

1
GlowingEagle40•

I'm assuming you are using VBA. Then, create a new (empty) string variable, make a loop to read cells from the column and append the cell value (followed by a comma) to the string. After the loop is complete, use something like "URL=Left(Len(URL)-1)" to drop the last comma.

1