Forum Discussion
life-work-balance
Oct 07, 2022Copper Contributor
Creating a list from selected cells more easily
Hi, I have a list of exercises for my clients. Each client has different exercises and the order is different for every person. I would like to create a list from the exercises that I select. At...
mtarler
Oct 07, 2022Silver Contributor
life-work-balance so it appears you want a list to copy and paste elsewhere and my original thought was to simply number the list and then create a helper column using SORT to arrange that list in the order you want. HOWEVER I noticed you used the same exercise 2x in the list so things got complicated. I created the following formula to parse a list with potential list of numbers:
=LET(in,A3:B12,
fin,FILTER(in,INDEX(in,,2)>0),
full_list,DROP(REDUCE(1,SEQUENCE(ROWS(fin)),LAMBDA(p,i,VSTACK(p,DROP(REDUCE("",TEXTSPLIT(INDEX(fin,i,2),","),LAMBDA(pp,ii,VSTACK(pp,IF({1,0},INDEX(fin,i,1),IFERROR(--ii,ii))))),1)))),1),
out,DROP(SORT(full_list,2),,-1),
out)
EXERCISE | STATUS | output list | |
(green = good, yellow = untested, blank = untried) | |||
Core exercise A | Core exercise C | ||
Core exercise B | Breathing exercise A | ||
Core exercise C | 1,5 | Leg exercise B | |
Arm exercise A | 7,9 | Arm exercise B | |
Arm exercise B | 4 | Core exercise C | |
Arm exercise C | 8,10 | Leg exercise C | |
Leg exercise A | Arm exercise A | ||
Leg exercise B | 3 | Arm exercise C | |
Leg exercise C | 6 | Arm exercise A | |
Breathing exercise A | 2 | Arm exercise C |
in the attached example I have a table like the 1st 2 columns and the formula in the 4th to create the desired list in order.
- life-work-balanceOct 08, 2022Copper ContributorThanks mtarler that works but it is more complicated for when I input the exercise. Cheers.