0
0
Google Sheetsspreadsheet~20 mins

Creating and opening spreadsheets in Google Sheets - Practice Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Spreadsheet Mastery: Creating and Opening
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📊 Formula Result
intermediate
2:00remaining
Opening a spreadsheet by URL
You want to open a Google Sheets spreadsheet using its URL in Apps Script. Which line of code correctly opens the spreadsheet?
ASpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/abc123')
BSpreadsheetApp.open('https://docs.google.com/spreadsheets/d/abc123')
CSpreadsheetApp.getByUrl('https://docs.google.com/spreadsheets/d/abc123')
DSpreadsheetApp.openById('https://docs.google.com/spreadsheets/d/abc123')
Attempts:
2 left
💡 Hint
Remember the method name includes 'ByUrl' when opening by URL.
Function Choice
intermediate
2:00remaining
Creating a new spreadsheet with a name
Which function creates a new Google Sheets spreadsheet with the name 'Budget 2024'?
ASpreadsheetApp.open('Budget 2024')
BSpreadsheetApp.new('Budget 2024')
CSpreadsheetApp.make('Budget 2024')
DSpreadsheetApp.create('Budget 2024')
Attempts:
2 left
💡 Hint
The method to create a new spreadsheet is named 'create'.
🎯 Scenario
advanced
2:30remaining
Accessing a spreadsheet by ID and getting its name
You have the spreadsheet ID '1a2b3c4d5e'. Which code snippet correctly opens the spreadsheet and gets its name?
Avar ss = SpreadsheetApp.open('1a2b3c4d5e'); var name = ss.getTitle();
Bvar ss = SpreadsheetApp.openById('1a2b3c4d5e'); var name = ss.getName();
Cvar ss = SpreadsheetApp.getById('1a2b3c4d5e'); var name = ss.getName();
Dvar ss = SpreadsheetApp.openByUrl('1a2b3c4d5e'); var name = ss.getName();
Attempts:
2 left
💡 Hint
Use the method that opens by ID and the method that returns the spreadsheet's name.
📊 Formula Result
advanced
2:00remaining
Result of creating and accessing a new spreadsheet
What is the output of this Apps Script code snippet? var ss = SpreadsheetApp.create('Test Sheet'); var name = ss.getName(); Logger.log(name);
Google Sheets
var ss = SpreadsheetApp.create('Test Sheet');
var name = ss.getName();
Logger.log(name);
ASpreadsheetApp
Bundefined
CTest Sheet
DError: Method getName() not found
Attempts:
2 left
💡 Hint
The getName() method returns the name of the spreadsheet.
data_analysis
expert
2:00remaining
Identifying error when opening spreadsheet by URL with wrong method
What error will this Apps Script code produce? var ss = SpreadsheetApp.open('https://docs.google.com/spreadsheets/d/abc123');
Google Sheets
var ss = SpreadsheetApp.open('https://docs.google.com/spreadsheets/d/abc123');
ATypeError: SpreadsheetApp.open is not a function
BReferenceError: open is not defined
CSyntaxError: Unexpected string
DNo error, spreadsheet opens successfully
Attempts:
2 left
💡 Hint
Check if the method 'open' exists in SpreadsheetApp.