This example covers the following functions:
ARRAYLEN- Returns 1-based number of elements in an array. See ARRAYLEN Function.
ARRAYELEMENTAT- Returns array element based on 0-based index parameter. See ARRAYELEMENTAT Function.
ARRAYSORT- Returns array sorted in ascending or descending order. See ARRAYSORT Function.
Here are some student test scores. Individual scores are stored in the
Scores column. You want to:
- Flag the students who have not taken four tests.
- Compute the range in scores for each student.
|Bell||Bobby||[85, 92, 94, 98]|
First, you want to flag the students who did not take all four tests:
This test flags Cameron Charles only.
The following transform sorts the array values in highest to lowest score:
The following transforms extracts the first (highest) and last (lowest) value in each student's test scores, provided that they took four tests:
Tip: You could also generate the
Error column when the
Scores4 column contains a null value. If no value exists in the array for the
ARRAYELEMENTAT function, a null value is returned, which would indicate in this case an insufficient number of elements (test scores).
You can now track change in test scores:
This page has no comments.