Forum Discussion
boukasa
Feb 25, 2023Brass Contributor
Increment a column only when a corresponding column changes, in a Lambda
I am trying to write a lambda that takes a sorted array an produces a corresponding numbering column that increments when the value in the source array changes. Like this: param result 1 ...
- Feb 26, 2023
Patrick2788
Feb 25, 2023Silver Contributor
Here's a solution with MAP:
Dynamic named item 'param'
=LET(p, Sheet1!$D$2:$D$1000, nonblank, COUNTA(p), TAKE(p, nonblank))
Lambda 'Locate'. To be used with MAP. Each element in the array will be matched within a unique list of the array.
=LAMBDA(e,XMATCH(e, UNIQUE(param)))
Sheet level formula:
=MAP(param,Locate)