We have a Google Sheets sheet where we track workouts. The first column is the exercise name, followed by a column for each workout day:
A B
Bob 01/01/2024
_CORE
crunches BW / 5 3 80s
_METABOLIC
running M / 6 6m
walking
--------------------------
SUMMARY 01/01/2024
_CORE
crunches BW / 5 3 80s
_METABOLIC
running M / 6 6m
We’re trying to make a summary of all exercises done in the bottom row. In our current attempt we succeeded but we’re struggling to get the summary in one cell, without the blank rows.
Here is a test sheet with an example.
Thank you for your help.
>Solution :
Here’s a generalized approach which you may adapt accordingly:
=reduce(C1,A3:A20,lambda(a,c,textjoin(char(10),1,a,if(left(c)="-",regexreplace(c,"^- ",),let(Σ,index(C:C,row(c)),if(Σ="",,"- "&c&" "&Σ))))))
