mark_b

How to merge 2 lists in custom function

Discussion created by mark_b on Apr 22, 2014
Latest reply on Apr 25, 2014 by Agnès

Hi All,

 

I am trying to build a custom function that will take 2 return separated lists (both have to be same ValueCount) and merge them into one list with values from each separated by a specified delimiter. An example will clarify: ListA = A¶B¶C and ListB = 1¶2¶3 and Delimiter = "|". The desired result would be: A|1¶B|2¶C|3. The length of the lists will be from 1 (not really a list) to maybe 5 at the most. So I figured some recursive custom function would be the answer. I looked through Brian Dunning's site and didn't find anything close.

 

The function should look something like: ConcatList (ListA; ListB; Delim; Next). "Next" would start out as 1 and the function would increment itself up to the ValueCount of either list and then exit, returning the desired new list. I understand the concepts but I can't get my head around the implementation. Thanks for any guidance.

 

Cheers, Mark

Outcomes