I have tried to write a custom function in google sheets.
I tried to create a function to joint the content of two cells. It works for text, however it does not work if the text contains a web-link (URL). The link is removed.
The code
function combine(...theArgs) {
var result ="";
var is_first = true;
theArgs.forEach( function (value, index){
if (! is_first) {
result += "\n\n";
}
is_first=false;
result += value;
});
return result;
}
Usage =combine(ref, ref)
e.g. =combine(a1,b1)
I tried to use =hyperlink(url,text)
, this can combine the text and link from different cells, so I then tried =hyperlink(url1, text1) & hyperlink(url2, text2)
. The &
is demoting the link to text (removes the url).
Acceptable answers: - How to get a custom function to work. - Use of built in function. - Something else that has the same effect.