Forum Discussion
TGMAN46
Feb 27, 2024Copper Contributor
Formula Needed
I have a need for a formula which allows in the left row A the numbers 1, 2, 3, etc, to be displayed, reflecting the sum of all prior entries in row B plus one. The excel sheet would look like this: ...
Patrick2788
Silver Contributor
If it's text or number, then in this context COUNTA is a better choice.
=LET(
last_text, XMATCH(TRUE, ISTEXT(B:B), , -1),
last_num, XMATCH(TRUE, ISNUMBER(B:B), , -1),
r, MAX(last_text, last_num),
words, TAKE(B1:B100000, r),
AutoNum, LAMBDA(element,
LET(
keep, ROW(element),
number, COUNTA(TAKE(words, keep)),
IF(ISBLANK(element), "", number)
)
),
MAP(words, AutoNum)
)
TGMAN46
Feb 28, 2024Copper Contributor
Thanks so much. COUNTA worked. Have a great day.
- Patrick2788Feb 28, 2024Silver ContributorYou're welcome!