Members-only tutorial
Watch the video and get the practice sheet with membership.
About this Tutorial
Sheet Resources
Video Transcript
<div>00:00 Hey Better Sheets members. Uh, thanks for watching this video.
This is going to be a little bit of, um, for the advanced folks here who are writing scripts and potentially who are writing scripts and creating spreadsheets for sale.<br>00:15 Um, if you're selling to someone, the user, or even using this with clients, creating a custom function Learn about functions and how they operate in Google Sheets. Opens in new tab , happens a lot custom functions Discover how to create and use custom functions in your spreadsheets. Opens in new tab or anything where Understand the query where clause for filtering data in Google Sheets. Opens in new tab you use a script, um, and you might call it something.<br>00:28 You go to say function Learn about functions and how they operate in Google Sheets. Opens in new tab , um, triple, and you say in this triple, we're going to use a number Explore how to work with numbers in Google Sheets formulas. Opens in new tab , some kind of input.<br>00:41 Um, what are we going to do with this info?
Well, we're going to just return, um, the input. What are we get times three.<br>00:51 Um, and let's see what happens, right? Well, let's do triple here. Now I'm getting this from the docs with you.<br>00:59 The docs use double, um, as an example. So let's go here and we write in triple, oh, let's just do triple five, right?<br>01:09 I probably now have to say this and now this works and it works. Right. So it's going to load that data Get insights on managing and analyzing data in Google Sheets. Opens in new tab .<br>01:17 It's going to take that five and can triple it or multiply it by three eventually. Right?
The first time it happens, it just loads for a long time, because it's very new.<br>01:28 And so for tripling five or five times three, it's 15, right? And now we have triple and we put any number Explore how to work with numbers in Google Sheets formulas. Opens in new tab in and I'll calculate it.<br>01:40 Right. So what's interesting is we can write these custom functions Discover how to create and use custom functions in your spreadsheets. Opens in new tab and then tell users that these exist. Right. Um, and then they'll do something like this, right?<br>01:52 They'll start typing and nothing will happen. Well, we can actually add auto, complete this.
This could actually give users the feeling that they're using.<br>02:01 Some native functionary and every native function Learn about functions and how they operate in Google Sheets. Opens in new tab has this auto-complete sum. And then it also tells us some interesting information about that, um, or useful information about that formula Review the syntax rules for writing formulas in Google Sheets. Opens in new tab or that, uh, function Learn about functions and how they operate in Google Sheets. Opens in new tab .<br>02:14 So let's see how, how to do this. And we're going to go right to the docs. It actually says it right here in the, in the Google app dots, I'm going to use their function Learn about functions and how they operate in Google Sheets. Opens in new tab double just to show you how this works.<br>02:27 And then we'll talk about some other things. I think you can use this for.
So we'll add that double. Um, we will save and we will write double and show you that now that works Double That number Explore how to work with numbers in Google Sheets formulas. Opens in new tab and we get these big numbers, right.<br>02:48 But we didn't get the auto complete. Well, how do we add the auto-complete?
We just use the comment Find out how to add comments to your Google Sheets scripts. Opens in new tab function Learn about functions and how they operate in Google Sheets. Opens in new tab , and we're going to do add custom function Learn about functions and how they operate in Google Sheets. Opens in new tab and we do this right double.<br>03:01 And it shows you right here at custom function Learn about functions and how they operate in Google Sheets. Opens in new tab in this, in this, um, comment Find out how to add comments to your Google Sheets scripts. Opens in new tab , uh, which usually I use these like slash slash write a bunch of comments Learn about the different types of comments you can use in scripts. Opens in new tab , maybe two, you can also do something like this.<br>03:16 And this is a comment Find out how to add comments to your Google Sheets scripts. Opens in new tab that you can add some information to a script in case someone needs to come and edit something.<br>03:21 So now let's look at writing double and it's right there.
Double what's really cool to two is right at this moment when someone's like, oh, I need to like, w what, how do I use this?<br>03:33 Right. We might have a very complicated function Learn about functions and how they operate in Google Sheets. Opens in new tab here. We might have something that involves two, three or four options. Um, we might have something where Understand the query where clause for filtering data in Google Sheets. Opens in new tab we definitely need to have quotes, right.<br>03:45 Or it needs to be some kind of number Explore how to work with numbers in Google Sheets formulas. Opens in new tab . Right. Um, we can add that here in the, um, Mo in the example, we have all this information filled out.<br>03:59 I will go through this piece by piece.
So now let's see what happens when you start typing double right away.<br>04:07 We get the word doubles. We know this works, right. If I was a user, I bought a sheet and it told me I have some custom scripts to work with some custom functions Discover how to create and use custom functions in your spreadsheets. Opens in new tab built only for this script, for this sheet.<br>04:18 And right away, it shows me like the, the thing that I'm trying to figure out, right. And how to use this.<br>04:26 Like, this is really good user experience, right? Multiplies the input value by two. Well, what is the input value? The input is the number Explore how to work with numbers in Google Sheets formulas. Opens in new tab I put here.<br>04:35 Oh, it's a number Explore how to work with numbers in Google Sheets formulas. Opens in new tab .
It could only be a number Explore how to work with numbers in Google Sheets formulas. Opens in new tab , right. If I do this, what does happen? See, it's like, oh, result was on number Explore how to work with numbers in Google Sheets formulas. Opens in new tab that's bad user experience.<br>04:45 I want a good user agreements. I need to put in a number Explore how to work with numbers in Google Sheets formulas. Opens in new tab . Right. So that's really cool that we can have all of this information.<br>04:52 Well, how do we get all of this information? This is, it says number Explore how to work with numbers in Google Sheets formulas. Opens in new tab here. It says multiplies the input value by to devalue, to multiply.<br>05:01 And it is all here in the, um, comments Learn about the different types of comments you can use in scripts. Opens in new tab . So the very first line is multiplies the input value by two.<br>05:10 Okay. Well, where Understand the query where clause for filtering data in Google Sheets. Opens in new tab did that show up?
That showed up in this, um, what I was called the about section, and it's also this like preview, right?<br>05:19 Multiplies the input value by two. So right here, This is a preview, right. It's also called about, and let's see what happens if C in it cuts it off.<br>05:39 Right. So we don't have all that other information, but I just have them. That's where Understand the query where clause for filtering data in Google Sheets. Opens in new tab it goes. Now this a program, what that means is parameter Understand parameters and their role in functions and scripts. Opens in new tab .<br>05:48 And then in these curly brackets, we're going to write number Explore how to work with numbers in Google Sheets formulas. Opens in new tab well, what, where Understand the query where clause for filtering data in Google Sheets. Opens in new tab did we see that?
We saw that right here.<br>05:57 So input, and this is number Explore how to work with numbers in Google Sheets formulas. Opens in new tab and we can write anything we want. We don't have to write number Explore how to work with numbers in Google Sheets formulas. Opens in new tab . We can write any texts.<br>06:03 We can say a number Explore how to work with numbers in Google Sheets formulas. Opens in new tab only Save that, go back and See. Now it says a number Explore how to work with numbers in Google Sheets formulas. Opens in new tab only, literally any texts we put in here.<br>06:17 Let's see. Literally any text We put in here, let's see what happens to that. There you go. Literally, any text you put in here goes in here, let's see.<br>06:32 And obviously we want to have just Like one or two numbers.
And even if gates are really Long string Explore how to manipulate strings in Google Sheets. Opens in new tab so long, Let's see what happens there.<br>06:45 I also put an intro and now It, some that was a little too emergency in this about it has this.<br>06:54 This is a preview. Cool. So anything We put here? Oh, about, and then let me just take off that, uh, move new line pattern.<br>07:07 Enter in there, See there, because literally it needs to be put in here. And even if it's a really long string Explore how to manipulate strings in Google Sheets. Opens in new tab , so long right there.<br>07:13 So that is a program.
So the very first thing we put in here, it's going to be about, then we can do app program and in the curly brackets, we'll reference Learn about referencing cells and ranges in your formulas. Opens in new tab , whatever is in here.<br>07:28 So if maybe it's input yeah. And A number Explore how to work with numbers in Google Sheets formulas. Opens in new tab we can say right here and put number Explore how to work with numbers in Google Sheets formulas. Opens in new tab , number Explore how to work with numbers in Google Sheets formulas. Opens in new tab , we can also maybe put first number Explore how to work with numbers in Google Sheets formulas. Opens in new tab second number Explore how to work with numbers in Google Sheets formulas. Opens in new tab and turn.<br>07:51 I don't think that'll work. Maybe it is a times number Explore how to work with numbers in Google Sheets formulas. Opens in new tab there. Double. They will call us and multiply. Cool.
So now we go back here, let me start writing double.<br>08:11 And there it is double and multiply, multiply the input value by two, but right there, when we start typing, Whoops, double and That's.<br>08:26 Okay. Right, right here, input number Explore how to work with numbers in Google Sheets formulas. Opens in new tab first number Explore how to work with numbers in Google Sheets formulas. Opens in new tab second number Explore how to work with numbers in Google Sheets formulas. Opens in new tab . Great. So we do 34 and that, and let's see what happens when I have to try again.<br>08:39 There you go. That's the result. Then we also have app return, which tells us what does this return? The input multiplied by two, the input multiplied by The name number Explore how to work with numbers in Google Sheets formulas. Opens in new tab by number Explore how to work with numbers in Google Sheets formulas. Opens in new tab , and then multiply by two.<br>09:00 Okay.
Let's see where Understand the query where clause for filtering data in Google Sheets. Opens in new tab that shows up. So right here. Nope. It's not there. Uh, Sarah we'll do this. Nope. Did I say never?<br>09:31 Well, times number Explore how to work with numbers in Google Sheets formulas. Opens in new tab then. Okay. And let's go back and look double multiply that. Uh, oh, I think it's because it's in this second line.<br>09:54 All right.
So the return isn't showing up, but one last thing I wanna mention is that normal comment Find out how to add comments to your Google Sheets scripts. Opens in new tab is going to look like, oh, sorry, normal multiline comment Find out how to add comments to your Google Sheets scripts. Opens in new tab is going to look something like this, where Understand the query where clause for filtering data in Google Sheets. Opens in new tab you have a slash then An ethics than asterix and slash.<br>10:11 And You can write anything in here has no effect on the, um, has no effect on the Functions Dive into the various functions available in Google Sheets. Opens in new tab . You're writing hand.<br>10:20 This however is two stars and it's not three. So if we use three, let's see what happens. We have nothing, right?<br>10:31 So the three stars doesn't work.
It is only two star and only two stars, not one, not three, two stars or Two asterixis and then ends with Discover how to use the ends-with function for string comparisons. Opens in new tab an asterisk down here.<br>10:43 And if you want any more information in here is, uh, some J JS doc.
And this goes through, if you prefer reading this information, doc, this is a really fun, uh, thing to find out that I recently found out that you can add this auto complete really makes a sheet feel really good.<br>11:02 And again, the use case that I think is really useful for this is if you're adding a custom menu Learn how to create custom menus in Google Sheets. Opens in new tab and a custom function Learn about functions and how they operate in Google Sheets. Opens in new tab to sheets that you're selling, these can really put it over the top, uh, to have someone feel like they really, this was made for them.<br>11:20 And the other, uh, I think really good use case is notes Understand how to use notes for better documentation in your sheets. Opens in new tab to yourself.
So if you find yourself writing a function Learn about functions and how they operate in Google Sheets. Opens in new tab and you're writing like some complicated C complicated function Learn about functions and how they operate in Google Sheets. Opens in new tab , right, and you have a few numbers here, number Explore how to work with numbers in Google Sheets formulas. Opens in new tab , number Explore how to work with numbers in Google Sheets formulas. Opens in new tab two, number Explore how to work with numbers in Google Sheets formulas. Opens in new tab also, number Explore how to work with numbers in Google Sheets formulas. Opens in new tab a range Explore how to define and use ranges in Google Sheets. Opens in new tab .<br>11:48 And then you have your pump Function Learn about functions and how they operate in Google Sheets. Opens in new tab and you find yourself, you know, commenting, This is a number and you're going to do number should be, and you can find yourself commenting things like this, right.<br>12:05 It might be a good opportunity to think, oh, I should add this functionality, right. Do star right here.
Start this jazz doc.<br>12:13 You like, oh, um, this complicated function Learn about functions and how they operate in Google Sheets. Opens in new tab , this results in a complicated number Explore how to work with numbers in Google Sheets formulas. Opens in new tab . Right. And now when I, right now, again, I'm just using this pump, you know, we have to add, we forgot to actually add it at Custom function Learn about functions and how they operate in Google Sheets. Opens in new tab , add that.<br>12:43 And now we do at complicated or At a really small error Get help with common errors encountered in Google Sheets. Opens in new tab at a need, of course not custom Com. It is a custom object.<br>13:00 So now complicated. Oh no, not again. Okay. I forgot to hit command S save. And now we do equals complicated function Learn about functions and how they operate in Google Sheets. Opens in new tab and this results in a complicated number Explore how to work with numbers in Google Sheets formulas. Opens in new tab .<br>13:18 So actually it's not the result.
This gets complicated numbers And puts the simple number Explore how to work with numbers in Google Sheets formulas. Opens in new tab . Right. And we can just do result.<br>13:32 Turns one, No matter what we put in there, it's just going to return one. Oh, it's not even gonna let us do that.<br>13:49 Okay. We're just going to return one, not return to one and no matter what we put in here, A Let's see if it gives us no errors, it just gives us one.<br>14:01 Um, this might be a really good use case.
If you are writing some complicated things, you want some specific numbers and you don't necessarily want to do say data validation Learn how to create and manage dropdowns in your spreadsheets. Opens in new tab .<br>14:12 You're, you're like, you know what whoever's using, this is going to be me. And I'm going to remember this, right.<br>14:17 Cause I'm writing number Explore how to work with numbers in Google Sheets formulas. Opens in new tab here, but I'm going to remember it by adding some, Um, comments Learn about the different types of comments you can use in scripts. Opens in new tab here, common here, and then Common here.<br>14:29 Uh, and you're gonna be reading this. This takes a lot of time. It takes a lot of time.
And then also makes these functions Dive into the various functions available in Google Sheets. Opens in new tab very hard to use later on when you're like six months down the road, you're like, what did, I mean here?<br>14:42 And you have to go into the script and you have to find it. This will bring that information Right here.<br>14:49 So we can do something like parameters Understand the importance of parameters in functions. Opens in new tab number Explore how to work with numbers in Google Sheets formulas. Opens in new tab , number Explore how to work with numbers in Google Sheets formulas. Opens in new tab range Explore how to define and use ranges in Google Sheets. Opens in new tab . And we can remember that right here, right there. Number Explore how to work with numbers in Google Sheets formulas. Opens in new tab , number Explore how to work with numbers in Google Sheets formulas. Opens in new tab range Explore how to define and use ranges in Google Sheets. Opens in new tab .<br>15:02 We probably should have a spate of enter there. Let's see if That changes things. There you go. Number, number also range.<br>15:13 All right.
So found one more interesting wrinkle here is that you can name anything you want here. These like inputs that you have, you just have to use parameters Understand the importance of parameters in functions. Opens in new tab .<br>15:27 Then the curly brackets and the name, the exact texts that you have here. So here's number Explore how to work with numbers in Google Sheets formulas. Opens in new tab one, here's number Explore how to work with numbers in Google Sheets formulas. Opens in new tab two.<br>15:34 And now you can add as many parameters Understand the importance of parameters in functions. Opens in new tab you want. You can Write, um, Range Explore how to define and use ranges in Google Sheets. Opens in new tab here. And now we do at PARiM.<br>15:42 We do what our texts, we want it to display, uh, any range Explore how to define and use ranges in Google Sheets. Opens in new tab .
And then we just say range Explore how to define and use ranges in Google Sheets. Opens in new tab , and we say, the range Explore how to define and use ranges in Google Sheets. Opens in new tab you need.<br>15:55 Now this will show up in complicated function Learn about functions and how they operate in Google Sheets. Opens in new tab , that there's number Explore how to work with numbers in Google Sheets formulas. Opens in new tab , number Explore how to work with numbers in Google Sheets formulas. Opens in new tab , any range Explore how to define and use ranges in Google Sheets. Opens in new tab . And then down here, it says, number Explore how to work with numbers in Google Sheets formulas. Opens in new tab one, right here, number Explore how to work with numbers in Google Sheets formulas. Opens in new tab one, number two.<br>16:06 And it describes it in more detail here.
So this is really, really powerful again, because you can, uh, create very complicated functions Dive into the various functions available in Google Sheets. Opens in new tab instead of leaving comments Learn about the different types of comments you can use in scripts. Opens in new tab or in addition to leaving comments Learn about the different types of comments you can use in scripts. Opens in new tab and, and describing how this works.<br>16:25 You can let a user know when that user might be you in six months, um, or that might be a user you're selling a sheet to.<br>16:32 So this is a really useful thing.
If you're selling sheets or even selling, not selling sheets, selling your time as a consultant, or you're working in an office and you're like, you know what, there's this really complicated math problem that we all do.<br>16:45 Um, I want to make it a custom function Learn about functions and how they operate in Google Sheets. Opens in new tab , but I want others to know how it works. Right.
Um, and describe very clearly what they have to put in and then what they get out of it right here in this script and right here in the text of the script, so that it shows up to someone as if it were a native function Learn about functions and how they operate in Google Sheets. Opens in new tab , I think is really, really powerful.<br>17:07 And it could really be really cool if you end up using this and you can share Find out how to share your Google Sheets with others. Opens in new tab me a screenshot of it, let me know.<br>17:15 I'd be really excited to see how you use it.
Um, if you're using it for yourself to keep yourself notes Understand how to use notes for better documentation in your sheets. Opens in new tab , or if you're using it to sell to clients, if you're sharing Find out how to share your Google Sheets with others. Opens in new tab it in an office and you're like, oh my God, yes, people kept asking me about this.<br>17:29 One thing that I wrote, this one function Learn about functions and how they operate in Google Sheets. Opens in new tab that I wrote. Um, I think this makes sheets really, really a lot better.<br>17:36 Thanks so much for watching this whole video. Hopefully this was really helpful to you.
Again, you can find this in the custom function Learn about functions and how they operate in Google Sheets. Opens in new tab docs, but I had never known about this before recently.<br>17:50 And didn't know about this JS doc custom function Learn about functions and how they operate in Google Sheets. Opens in new tab tag that does this. So I think it was really, really cool and something that I can use a lot.</div>
Courses
Sheet Stories / Video Notes + ADDED: Email Notifications
00:00:00
Fast FAQS
Enter Google Drive File Name Get URL
ChatGPT Clone in Google Sheets Part 2
Create an Internal Google Sheets Add-on
Tweet From a Sheet
Why Different Cell References in AI Integration in Sheets?
Show Sheet Tabs Based on Edit
Add Title Case to Google Sheets
How to Power Testimonials with Google Forms and Sheets
Getting Started Coding in Apps Script
Seek Errors When Coding Apps Script
Think Like a Programmer: Develop The Mindset of an Apps Script Coder
ChatGPT Clone in Google Sheets Part 1
Embed a Number in a Website from a Google Sheet
Create Navigation Like A Book or Presentation
Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet
00:29:08
Hold a Giveaway Raffle in a Google Sheet
Quickstart Tutorial OpenAI API in Google Sheets
Capture Emails from Website Form to a Google Sheet (Without Zapier)
Embed a Headline in a Website from Google Sheets
Create a new Spreadsheet from just a Name in a Sheet.
00:05:21
Bjarne Asks: Can I show the Last Time of the Last Edit in a sheet?
00:05:43
Email Yourself a Cell from a Google Sheet, Every Day
OpenSea Data Inside Sheets
Create an Email Campaign Stats Calculator
00:35:13
Twitter App Clone in a Google Sheet
Dylan Asks: How to Automatically Delete Rows If Cell Contains Value
Highlight Row as You Move Your Cell Selection
Create a Timer with Apps Script
LinkTree in a Google Sheet
00:11:22
Password Protecting Data In a Google Sheet
Automatic Weekly Backup of Google Sheets
Create a CPM Custom Function (Create Better Calculators!)
Move Entire Row when a Cell is changed to "Yes" - The $75,000 Google Script
00:12:29
What Can You Automate in Google Sheets? Every single trigger available to Google Sheet users
Sync Two Tabs Without ImportRange()
Google Sheets Stories? No! But we'll add timestamped video notes to your google sheets.
00:00:00
Password Protecting Data In a Google Sheet Part 2 The Basics
Benoit Asks: How to Convert Case
00:07:35
Learn to Code in Google Sheets, For Programmers
Add a Checkbox to Turn on Dark Mode
00:05:10
Write Your First Script
00:08:31
Find Keywords in Any Column. Create quick search dropdown to find keywords
00:09:37
Basic CRM - Add a Powerful Script To Move Row Based on Status
How To Improve: 1,000 Business ideas: Business Idea Generator
00:11:20
Let's Make a Bookmarklet!
00:12:37
Troubleshooting Bitly in a Google Sheet Script
00:07:07
Unique Features - Design a Better Dashboard Part 2
00:04:13
How To Set Up Stripe Webhook to Google Sheets with Google Script
00:22:10
How to Edit a Macro
00:08:22
Sheet Stories / Video Notes + Clear 24 Hour Old Videos
00:35:10
Add A Timestamp to Task Lists (without Now Formula)
00:07:44
Make your Custom Functions Like Native Functions | Custom Function Autocomplete
00:17:58
Create a Changelog Between 2 Cells Custom Function | To learn Double For Loop
00:23:26
New Syntax for WhatChanged Formula in Google Script
00:07:14
How to Record Macros
00:06:20
2 Ways to Delete Lines Quickly (CAREFUL, it's a script!)
00:09:53
Deep Inside Dark Habits Google Script
00:18:54
How to Trigger Macros Daily
00:06:58
5 Ways to Create Coupon Codes | Create UUIDs
Create a Radio Button From Checkboxes Using Google Apps Script
00:15:01