1

I am writing a SPLIT function using the new lambda function to recursively pull items out of a text string, based on a delimiter.

The problem is that I need to keep a variable length list in memory of these items as I find them, ie a list that grows in length as I add items.

ZygD
  • 22,092
  • 39
  • 79
  • 102
dbb
  • 2,827
  • 18
  • 16
  • Not sure if it helps, but check out [this](https://stackoverflow.com/a/65363987/9758194) older post which I'm sure can now also be tidied up since the introduction of `REDUCE()`. – JvdV Oct 31 '21 at 07:40

1 Answers1

2

I couldn't find a solution online, but eventually stumbled on this simple approach. This creates a new list by adding a new item B to the end of an existing list A

IF(SEQUENCE(1,COUNTA(A)+1)<COUNTA(A)+1, A, B)

I thought this might be useful for anyone doing recursive lambdas.

dbb
  • 2,827
  • 18
  • 16