Tag data with Student Name
In sheet1
, insert a helper column A
and add the following formula in cell A7
and copied to rows below:
=if(B7<>"",if(B6="Advisor",B5,A6),"")
Helper Column

Calculations
Named Ranges
To make the formulas shorter in length and easier to follow, I used named the ranges. You could alternatively use the A1 range addresses
Name |
Range |
helper |
Sheet1!A:A |
advisor |
Sheet1!B:B |
average |
Sheet1!K:K |
level |
Sheet1!G:G |
grade |
Sheet1!L:L |
beCols |
Sheet1!N:O |
names * |
Sheet2!A2:A * the filtered list on Sheet2 |
Formulas
Multiple Formulas |
Sheet2!A2 - Student
SORT(UNIQUE(FILTER(helper,helper<>"")),1,1) |
Sheet2!B2 - Advisor
=BYROW(names, LAMBDA(x, IF(x<>"", INDEX(advisor,MATCH(x,helper, 0)),))) |
Sheet2!C2 - HL Sum
=BYROW(names, LAMBDA(x, IF(x<>"", SUMIFS(grade,helper,x,level,"HL"),))) |
Sheet2!D2 - SL Sum
=BYROW(names, LAMBDA(x, IF(x<>"", SUMIFS(grade,helper,x,level,"SL"),))) |
Sheet2!E2 - BE Count
=BYROW(names, LAMBDA(x, IF(x<>"", COUNTIF(filter(beCols, helper=x),"BE"),))) |
Depending on what you want, you can combine all the formulas in a single formula.
Single Formula
In Sheet2!A2, place
=BYROW(SORT(UNIQUE(FILTER(helper,helper<>"")),1,1),
LAMBDA(x, IF(x<>"", {
INDEX(names,MATCH(x,names,0)),
INDEX(advisor,MATCH(x,helper,0)),
SUMIFS(grade,helper,x,level,"HL"),
SUMIFS(grade,helper,x,level,"SL"),
COUNTIF(filter(beCols, helper=x),"BE")},)))
If you want to generate the column labels as well you can add them into the formula
={ "Student","Advisor","HL Sum","SL Sum","BE Count";
[existing formula here]
}
Images
Single Formula w/ Labels

Student Formula

Advisor Formula

HL Formula

SL Formula

BE Formula
