Forum Discussion
Structured References
Thanks so much for your help! I'm very grateful 🙂
Please check the attached file.
I have already completed the copying process using Traditional formulas. Now I want to see if it's possible using cell references... As i mentioned, I think it is good if the table can resize as needed as then there will be no chance of my output table losing data (when the input exceeds 30 rows). I'm a teacher and I'm trying to set up systems for tracking students for the whole school. The file is not sensitive (has fake names).
I could easily workaround the issue by setting class size of 100 rows... but I'm trying to learn more about table references, which some consider to be the "proper" way to structure references.
Beyond a solution to the above scenario, I would be interested to know:
- what you think about Structured Table References vs traditional formulas.
- Could you suggest some learning resources for STR. How did you learn?
Thanks again for your help!!
In this case structured references are not going to give you much. They have the advantage of allowing you to know the precise extent of your data but, by the time you have combined different sized classes, then the space you need is dictated by the largest group.
The most concise formulation would start with a 3D range with, as you suggest, space for 100 records. Stacking would give a list of 700 records in which first and last names could be concatenated. WRAPCOLS would return the 7 columns of 100 records,
= LET(
stacked, VSTACK(Table3D),
firstName, TAKE(stacked,,-1),
lastName, TAKE(stacked,, 1),
fullNames, firstName & " " & lastName,
WRAPCOLS(fullNames,33)
)The alternative, developed in the workbook, would be to use table names one at a time within REDUCE. HSTACK builds the output array class by class.
= LET(
table, REDUCE("", SEQUENCE(1,7),
LAMBDA(acc,k,
LET(
classList, CHOOSE(k, MS_1,MS_2,MS_3,SS_1,SS_2,SS_3,SS_4),
firstName, TAKE(classList,,-1),
lastName, TAKE(classList,, 1),
fullName, firstName & " " & lastName,
HSTACK(acc, fullName)
)
)
),
IFNA(DROP(table,,1),"")
)Sadly, combining data from an arbitrary number of sheets by formula is not going to be pretty.
- JonBastiansJun 05, 2023Copper Contributor
Thanks to you too PeterBartholomew1
I may well try your solution too. Thanks for pointing out that tables = unordered lists. That makes sense. I had never thought of it that way. So much to learn 🙂