Challenge - 5 Problems
Custom Functions Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📊 Formula Result
intermediate1:30remaining
Output of a simple custom function
You created this custom function in Google Sheets:
What will be the output in cell A1 if you enter
function DOUBLE(input) { return input * 2; }What will be the output in cell A1 if you enter
=DOUBLE(5)?Google Sheets
function DOUBLE(input) { return input * 2; }
Attempts:
2 left
💡 Hint
Think about what doubling 5 means.
✗ Incorrect
The function multiplies the input by 2, so DOUBLE(5) returns 10.
❓ Function Choice
intermediate2:00remaining
Choosing the correct custom function for text manipulation
You want a custom function that takes a text string and returns it in uppercase.
Which of these custom functions will work correctly in Google Sheets?
Which of these custom functions will work correctly in Google Sheets?
Attempts:
2 left
💡 Hint
JavaScript strings have a method to convert to uppercase.
✗ Incorrect
The correct JavaScript method is toUpperCase(), so option D is correct.
📊 Formula Result
advanced2:30remaining
Output of a custom function with array input
Given this custom function:
What is the output of
function SUMPLUSONE(range) {
let sum = 0;
for (let i = 0; i < range.length; i++) {
sum += range[i][0];
}
return sum + 1;
}What is the output of
=SUMPLUSONE(A1:A3) if cells A1=2, A2=3, A3=4?Google Sheets
function SUMPLUSONE(range) { let sum = 0; for (let i = 0; i < range.length; i++) { sum += range[i][0]; } return sum + 1; }
Attempts:
2 left
💡 Hint
Sum the values 2 + 3 + 4, then add 1.
✗ Incorrect
Sum is 2+3+4=9, plus 1 equals 10.
🎯 Scenario
advanced2:00remaining
Debugging a custom function that returns #NAME!
You wrote this custom function:
When you use
What is the most likely reason?
function CONCATENATE_TWO(a, b) {
return a + b;
}When you use
=CONCATENATE_TWO("Hello", "World") in your sheet, it shows #NAME!.What is the most likely reason?
Google Sheets
function CONCATENATE_TWO(a, b) {
return a + b;
}Attempts:
2 left
💡 Hint
Think about what happens if the script is not properly saved.
✗ Incorrect
If the script is not saved, the sheet cannot find the function, causing #NAME!.
❓ data_analysis
expert3:00remaining
Analyzing output of a custom function with nested arrays
Consider this custom function:
If you enter
function FLATTEN_AND_SUM(input) {
let flat = input.flat();
return flat.reduce((a, b) => a + b, 0);
}If you enter
=FLATTEN_AND_SUM({1,2;3,4}) in a cell, what is the output?Google Sheets
function FLATTEN_AND_SUM(input) { let flat = input.flat(); return flat.reduce((a, b) => a + b, 0); }
Attempts:
2 left
💡 Hint
The input {1,2;3,4} is [[1,2],[3,4]], flat() gives [1,2,3,4], sum is 10.
✗ Incorrect
input.flat() flattens the 2D array to [1,2,3,4], reduce sums to 10.