I'd like a function in Google Sheets to concatenate elements with a chosen delimiter like join(), but without excess delimiters at beginning, end, and between null elements. I accomplished this with REGEXREPLACE() as below:
With Formula 3, delimiters are neither first, last, nor repeated. However, the formula is long and unwieldy.
Is there a better approach? On my small spreadsheet, speed is not an issue. I know I could write a custom function, but would like to avoid that if possible.
Use of filter() as suggested by NormalHuman solves the problem when the elements to be joined are in a contiguous range. Is there also a good solution without resorting to join(split(join(...))) when selecting individual cells as in:
=join(char(10), g3, f3, h3, i3)