Dec 23 2022 10:28 PM
Dec 23 2022 10:28 PM
I need to use the FILTER function to filter the range (C6:Q55) of the attached file to get the student name who got degree less the 50 in any defined subject (D4:Q4). The defined subjects should be changed dynamically and not fixed. However, there are listed in a range (D4:Q4). The result is explained in column S of the attached file.
Dec 24 2022 01:28 AM
Dec 24 2022 02:02 AMSolution
Does this function update dynamically? I mean that if I change the degree from <50 to >50 the elements will be changed? => Why don't you try???
A sligthly more concise one:
=FILTER(C6:C55, MMULT(--(D6:Q55 < 50),SEQUENCE(COLUMNS(D4:Q5))) )
Dec 24 2022 07:31 AM
This differs more in style than substance. First, because I would never use a direct cell reference I name the data, headers and row-headers 'marks', 'subjects' and 'students' respectively. The formula I used is given by
= LET( Sumλ, LAMBDA(x, SUM(x)), fails, SIGN(marks<threshold), countFails, BYROW(fails, Sumλ), FILTER(students, countFails) )
The first line defines the Lambda function 'Sumλ' for later use. I could have used a defined name or simply used the anonymous Lambda function. The next line works on the entire array of marks, returning 1 for any fail. MMULT is a very fast and effective function but is somewhat mathematical so I chose to use the modern Lambda helper function BYROW to present the rows for summation one by one. Finally, filter is used to remove the student names that have no failed subjects.
Dec 24 2022 03:12 PM - edited Dec 24 2022 03:13 PM
Great use of Lambda to solve the problem Peter - nice and easy to follow.
I wish I could learn and propose answers using Lambda but my version of Excel is on semi-annual enterprise and the company does not have access to Lambda functions; plus my co-workers would not have a clue as to how to review my work!
Dec 24 2022 03:47 PM
Your company may well need some more IT oriented staff to test the new functionality before it is released company-wide. Your IT department / person could set one or two of you up with the insiders beta version. I believe that to use the new functionality effectively requires 'retraining one's brain'.