0
0
Google Sheetsspreadsheet~10 mins

Reading and writing cell values in Google Sheets - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the formula to read the value from cell A1.

Google Sheets
= [1]("A1")
Drag options to blanks, or click blank then click option'
AINDIRECT
BREAD
CCELL
DVALUE
Attempts:
3 left
💡 Hint
Common Mistakes
Using CELL instead of INDIRECT, which returns cell info but not the value directly.
Using VALUE which converts text to number but does not read cell content.
Using READ which is not a valid Google Sheets function.
2fill in blank
medium

Complete the formula to write the value 100 into cell B2 using Apps Script syntax.

Google Sheets
sheet.getRange("B2").[1](100);
Drag options to blanks, or click blank then click option'
AsetValues
BsetValue
CgetValues
DgetValue
Attempts:
3 left
💡 Hint
Common Mistakes
Using getValue which reads instead of writes.
Using setValues which expects an array, not a single value.
Using getValues which reads multiple cells.
3fill in blank
hard

Fix the error in this formula to read the value from cell C3.

Google Sheets
=INDIRECT([1])
Drag options to blanks, or click blank then click option'
AC3
BC"3"
CINDIRECT("C3")
D"C3"
Attempts:
3 left
💡 Hint
Common Mistakes
Passing C3 without quotes causes a reference error.
Using INDIRECT("C3") inside INDIRECT is redundant.
Using invalid syntax like C"3".
4fill in blank
hard

Fill both blanks to create a formula that writes the sum of cells A1 and A2 into cell B1 using Apps Script.

Google Sheets
sheet.getRange("B1").[1](sheet.getRange("A1").[2]() + sheet.getRange("A2").getValue());
Drag options to blanks, or click blank then click option'
AsetValue
BgetValue
CsetValues
DgetValues
Attempts:
3 left
💡 Hint
Common Mistakes
Using setValues instead of setValue for a single cell.
Using getValues which returns arrays, not single values.
Mixing up getValue and setValue methods.
5fill in blank
hard

Fill all three blanks to create a dictionary (object) in Apps Script that maps cell addresses to their values for A1, B1, and C1.

Google Sheets
const values = {"A1": sheet.getRange("A1").[1](), "B1": sheet.getRange("B1").[2](), "C1": sheet.getRange("C1").[3]()};
Drag options to blanks, or click blank then click option'
AgetValue
BsetValue
CgetValues
DsetValues
Attempts:
3 left
💡 Hint
Common Mistakes
Using setValue or setValues which write values instead of reading.
Using getValues which returns arrays, not single values.