0
0
Google Sheetsspreadsheet~10 mins

Script editor overview in Google Sheets - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

A simple list of names and their scores in a spreadsheet.

CellValue
A1Name
B1Score
A2Alice
B285
A3Bob
B390
A4Carol
B478
Formula Trace
Custom script function: getAverageScore()
Step 1: Access spreadsheet data range B2:B4
Step 2: Calculate sum of scores: 85 + 90 + 78
Step 3: Count number of scores: 3
Step 4: Divide sum by count: 253 / 3
Step 5: Return average score: 84.33
Cell Reference Map
    A       B
1 | Name  | Score |
2 | Alice |  85   |
3 | Bob   |  90   |
4 | Carol |  78   |

-> Script reads B2:B4 for scores
The script uses the scores in cells B2 to B4 to calculate the average.
Result
    A       B       C
1 | Name  | Score | Avg |
2 | Alice |  85   |     |
3 | Bob   |  90   |     |
4 | Carol |  78   | 84.33|

Cell C4 shows the average score calculated by the script.
The average score 84.33 is displayed in cell C4 after running the script.
Sheet Trace Quiz - 3 Questions
Test your understanding
What data does the script read to calculate the average?
ACells B2 to B4
BCells A2 to A4
CCells A1 to B1
DCells C2 to C4
Key Result
Script editor functions can read cell ranges, perform calculations, and return results to the sheet.