4 scripts to make Google Sheets stronger

Google Sheets or Google Sheets is one of the most powerful free tools, allowing you to track, analyze or take notes of everything you can imagine. Not stopping there, you can enhance its capabilities with Googe Scripts (Google Script).

Download Google Sheets for iOS

Download Google Sheets for Android

Google Scrips sounds complicated and confusing. You may think it involves advanced programming knowledge but it really isn't. This article will introduce you to four simple scripts that help you customize functions, automatically create charts based on any data, customize your menu in Google Sheets, and even automate it. monthly email delivery.

1. Create your own custom functions

Creating custom functionality is one of the easiest ways to create a Google Scripts that can enhance your Google Sheets experience. Google Sheets has provided a long list of available functions. You can view the most popular ones by clicking on the function icon on the menu.

4 scripts to make Google Sheets stronger

Then click on More functions ... to open a list of algorithms, finances, techniques and more. However, Google Scripts gives you the flexibility to create your own personal formulas.
To create your first custom function, you'll first need to open the script editor by clicking Tools> Script Editor.

4 scripts to make Google Sheets stronger

You should see a window appear similar or similar to below.

4 scripts to make Google Sheets stronger

What you need to do is replace what is in this window with your own custom functionality. The function name is the same as the one you will start typing into a cell in Google Sheets after the "=" symbol to call your formula. A function to convert Celsius to Fahrenheit would look like this:

function CSTOFH (input) {
return input * 1.8 + 32;
}

Paste the above functions into the code window and then select File> Save , name the project "CelsiusConverter" and click OK.

That is all you have to do. You start using your new function by typing "=" followed by your function, with the number entered to convert:

4 scripts to make Google Sheets stronger

Hit enter and you will get results.

4 scripts to make Google Sheets stronger

2. Automatically create charts

You can have a new spreadsheet every month with new data and you want to automatically create a new chart without having to recreate it every month. You can do this by creating a function that will create a new chart for you based on the data in the current workbook you have opened.

Suppose you are a teacher and at the end of the year you have a spreadsheet for each student with a list of monthly test scores:

4 scripts to make Google Sheets stronger

What you want to do is run a single function on this table that will automatically generate a chart in seconds. The script will look like this:

function GradeChart () {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet ();
var sheet = spreadsheet.getSheets () [0];

var gradechart = sheet.newChart ()
.setChartType (Charts.ChartType.LINE)
.addRange (sheet.getRange ('A1: B11'))
.setPosition (5, 5, 0, 0)
.build ();

sheet.insertChart (gradechart);
}

All you have to do is open each student's spreadsheet and click the run icon in the menu in Google Scripts to automatically create the chart.

4 scripts to make Google Sheets stronger

Whenever you click the run icon, it will run the script that you created on the "active" spreadsheet (a workbook you have opened in your current browser tab).

4 scripts to make Google Sheets stronger

For reports that you have to create regularly, like weekly or monthly, this type of auto-charting function can really save you a lot of time, because you don't have to recreate from scratch. When you want to import chart data on a new worksheet.

3. Create custom Menu

If you don't want a script to automatically generate charts and want that functionality right at your fingertips on the menu system in Google Sheets, you can make that happen.

To create a custom menu, you need to give the spreadsheet a new menu item every time it opens. You can do this by creating an onOpen () function in the Script Editor window above the Gradechart function you just created.

function onOpen () {
var spreadsheet = SpreadsheetApp.getActive ();
var menuItems = [
{name: 'Create Grade Chart ...', functionName: 'GradeChart'}
];
spreadsheet.addMenu ('Charts', menuItems);
}

Save the code and then reload your spreadsheet. You will discover that a new menu item appears with the name you specify it in your script. Click on the menu and you will see the menu item for that function.

4 scripts to make Google Sheets stronger

Click the menu item and it will run the same functions as it did when you click the run icon from within the Google Scripts editor.

4. Send the report automatically

The last script is a script that will email from within Google Sheets. This can be useful if you are managing a large group of people and you have to send multiple emails on the same subject. You may have performed a performance review with each team member and have recorded your review comments for each person in Google Spreadsheets. It is very convenient and time-saving to just run a single script and the reviews will be automatically sent to 50 or 60 people at the same time without having to create each email and send it individually. That is the power of Google Scripting.

Similar to the way you created the scripts above in this article, you will create a script for automatic report submission by going to the script editor and creating a function called sendEmails () , as follows: :

function sendEmails () {
var sheet = SpreadsheetApp.getActiveSheet ();
var startRow = 2; // First row of data to process
var numRows = 7; // Number of rows to process
var dataRange = sheet.getRange (startRow, 1, numRows, 3)
var data = dataRange.getValues ​​();
for (i in data) {
var row = data [i];
var emailAddress = row [1]; // Second column
var message = row [2]; // Third column
var subject = "My review notes";
MailApp.sendEmail (emailAddress, subject, message);
}
}

So, suppose you have the worksheet organized as shown here.

4 scripts to make Google Sheets stronger

The above script will do everything through each row in the spreadsheet and send an email to the address in the second column with the message you entered in the third column.

The sendEmail function in Google Scripts is one of the most powerful functions in Google Scripts because it opens up a world of email automation that you have never considered before.

If in reality you have someone else responsible for importing data into your Google spreadsheet, and if you automatically deliver emails based on the entered data, you can do something like send a monthly report to Boss, that never really needs to open his customer email. The script can automatically do all the work for you.

All these features of Google Scripts will show you that with just a few simple lines of code, Google Scripts has the right to automate part or all of Google Sheets. These automation can be set to run on schedule or run whenever you want to enable them. Either way, they provide you with a way to automate a lot of work without spending a lot of effort and time.

Leave a Comment

How to copy or duplicate an entire spreadsheet in Google Sheets

How to copy or duplicate an entire spreadsheet in Google Sheets

Basically, moving or copying the entire contents of a Google Sheets spreadsheet isn't much different from what you might be familiar with when working with Microsoft Excel.

5 Best Google Sheets Add-ons to Make Data Analysis Easier

5 Best Google Sheets Add-ons to Make Data Analysis Easier

Google Sheets is a powerful tool for data analysis, but sometimes you need more power. There are plenty of add-ons that can speed up your spreadsheets and take your data processing to the next level.

How to Add Gemini to Improve Your Google Sheets Experience

How to Add Gemini to Improve Your Google Sheets Experience

Tired of spending hours creating spreadsheets and entering data manually? You'll be glad to know that you can use Gemini's creation features with Google Sheets to automate tasks and improve your overall experience.

How to Export Airtable to Excel and Google Sheets

How to Export Airtable to Excel and Google Sheets

Airtable lets you create and share relational databases easily. Export your Airtable data to Google Sheets or Excel to enjoy the benefits of advanced charts and data visualization.

How to Create a Monthly Spending Tracker on Google Sheets

How to Create a Monthly Spending Tracker on Google Sheets

Finances can be a daunting task, but thanks to Google Sheets, keeping track of your spending doesn't have to be a hassle. You don't have to invest in another software either.

How to Track Registrations Using Google Sheets

How to Track Registrations Using Google Sheets

Google Sheets is the only tool you need to record and manage these subscriptions.

Set location in Google Sheets

Set location in Google Sheets

Google Sheets has location settings that are easy to use and useful. Here's what you need to know about using settings in Google Sheets.

Why are so many people stopping using Google Sheets and going back to Excel?

Why are so many people stopping using Google Sheets and going back to Excel?

For a while, Google Sheets lured people away from Excel. But many people came back after realizing that Google Sheets is far from beating Excel.

Is Gemini in Google Sheets as advertised?

Is Gemini in Google Sheets as advertised?

Since Gemini in Google Sheets provides textboxes, you can ask it to do anything. But what can Gemini in Google Sheets actually do and where does it fall short?

How to use the FILTER function in Google Sheets

How to use the FILTER function in Google Sheets

How to use the FILTER function in Google Sheets, The FILTER function in Google Sheets allows you to filter data and return rows that meet specific criteria. Here's how to use it

How to turn a Google Sheets spreadsheet into a colorful rainbow

How to turn a Google Sheets spreadsheet into a colorful rainbow

To celebrate the International Pride Month, Google allows users to turn a dry, monotonous spreadsheet into a colorful rainbow extremely quickly.

Instructions to insert Checkbox on Google Sheets

Instructions to insert Checkbox on Google Sheets

The following article will show you how to insert checkboxes into a cell in Google Sheets (Google Sheets).

Common keyboard shortcuts for Google Sheets

Common keyboard shortcuts for Google Sheets

Google Sheets is an online spreadsheet creator that allows users to create and edit spreadsheet files quickly and conveniently.

How to open Excel file on iPhone and iPad?

How to open Excel file on iPhone and iPad?

Looking for an application that allows you to view and edit Excel sheets and files on your iPhone and iPad? So do not miss the following tools.

How to Fix Microsoft Teams Welcome Error Startup Loop

How to Fix Microsoft Teams Welcome Error Startup Loop

Struggling with Microsoft Teams "Welcome Error" startup loop? Discover step-by-step fixes to resolve the issue quickly. Clear cache, reset app, and more for seamless Teams experience. Updated with latest solutions.

How to Fix Microsoft Teams Disabled Error Account Blocked

How to Fix Microsoft Teams Disabled Error Account Blocked

Stuck with Microsoft Teams "Disabled Error" Account Blocked? Discover proven, step-by-step solutions to fix the issue fast, regain access, and prevent future blocks. No tech skills needed!

How to Use Microsoft Teams Copilot for AI-Powered Meetings

How to Use Microsoft Teams Copilot for AI-Powered Meetings

Master how to use Microsoft Teams Copilot for AI-powered meetings. Step-by-step guide with latest tips to generate recaps, answer questions, and boost productivity effortlessly. Transform your Teams experience today!

Microsoft Teams Breakout Rooms Tutorial for Beginners (2026)

Microsoft Teams Breakout Rooms Tutorial for Beginners (2026)

Master Microsoft Teams Breakout Rooms with this beginner-friendly tutorial. Step-by-step guide to creating, managing, and optimizing breakout rooms for dynamic 2026 meetings and workshops. Boost engagement now!

Solving Microsoft Teams Recording Save Error

Solving Microsoft Teams Recording Save Error

Stuck with Microsoft Teams Recording Save Error? Get instant, step-by-step fixes for saving recordings effortlessly. Proven solutions for all common issues – no tech skills needed!

How to Create a Wiki Page in Microsoft Teams

How to Create a Wiki Page in Microsoft Teams

Discover how to create a Wiki page in Microsoft Teams effortlessly. This ultimate guide covers step-by-step instructions, tips, and best practices to boost your team's knowledge sharing and productivity. Perfect for beginners!

How to Fix Microsoft Teams Error S Screen

How to Fix Microsoft Teams Error S Screen

Stuck on Microsoft Teams "Error S" screen? Discover proven, step-by-step solutions to fix Microsoft Teams Error S fast. Clear cache, restart, update & more for seamless teamwork. Works on latest versions!

How to Fix Microsoft Teams Proxy Error on Windows 10

How to Fix Microsoft Teams Proxy Error on Windows 10

Struggling with Microsoft Teams proxy error on Windows 10? Discover step-by-step fixes to resolve proxy authentication issues, connection failures, and more. Get Teams running smoothly in minutes with our expert guide.

Solving Microsoft Teams Town Hall Event Error

Solving Microsoft Teams Town Hall Event Error

Tired of Microsoft Teams Town Hall Event Error ruining your events? Get step-by-step fixes for scheduling, access, and registration issues. Restore seamless virtual town halls today with our ultimate guide.

How to Download Microsoft Teams for Mac and MacBook Air/Pro

How to Download Microsoft Teams for Mac and MacBook Air/Pro

Discover the simplest way to download Microsoft Teams for Mac, MacBook Air, and MacBook Pro. Step-by-step instructions, system requirements, and troubleshooting tips for seamless installation in the latest version. Get started now!

How to Fix Microsoft Teams Web Login Error

How to Fix Microsoft Teams Web Login Error

Stuck with Microsoft Teams Web Login Error? Get instant fixes for common issues like "Something went wrong" or login loops. Step-by-step guide to resolve Teams web login problems and stay productive. Updated with latest browser tweaks.

How to Fix Microsoft Teams Error 657rx Update Failed

How to Fix Microsoft Teams Error 657rx Update Failed

Struggling with Microsoft Teams Error 657rx Update Failed? Discover step-by-step fixes, from quick restarts to advanced troubleshooting, to get your Teams app updated and running smoothly in minutes. No tech skills required!

Solving Microsoft Teams VDI Error Lag

Solving Microsoft Teams VDI Error Lag

Tired of Microsoft Teams "VDI Error" Lag freezing your video calls? This ultimate guide delivers step-by-step fixes for VDI environments like Citrix and VMware. Optimize performance now for lag-free collaboration!

Solving Microsoft Teams Join Meeting Error via Direct Link

Solving Microsoft Teams Join Meeting Error via Direct Link

Struggling with Microsoft Teams "Join Meeting Error"? Discover proven steps to solve it via direct links. Quick fixes for seamless joining – no tech skills needed!

How to Test Your Microsoft Teams Audio and Camera Before a Call

How to Test Your Microsoft Teams Audio and Camera Before a Call

Discover simple steps to test your Microsoft Teams audio and camera before a call. Ensure crystal-clear sound and video for professional meetings every time with our easy guide. Perfect for desktop, mobile, and web users.