Skip to Content

How to Make a Button in Google Sheets (With Examples)

Google Sheets is a versatile tool that goes beyond just number crunching. It can also help you streamline your workflows and make your spreadsheets more interactive. One way to do this is by creating buttons in Google Sheets. These buttons can trigger actions, making your tasks more efficient and user-friendly.

In this article, we’ll guide you through the process of making a button in Google Sheets step by step. 

Whether you’re a newbie just getting started with Google Sheets or someone with extensive knowledge of how this program works, rest assured that you’ll be able to make a button in Google Sheets after reading our comprehensive guide. 

We’ll also provide real-life scenarios where using buttons can be a game-changer. 

Scenario/Use Case

Let’s delve into a detailed scenario to grasp the transformative potential of making a button in Google Sheets.

Imagine you’re in charge of managing a vast inventory of products for an e-commerce store, and this inventory is maintained within a Google Sheet. Your task is to constantly update, filter, and sort this inventory based on different criteria – a time-consuming and potentially error-prone process.

The Problem

Your spreadsheet has thousands of rows of products with numerous attributes: product names, prices, stock levels, categories, and more. Your manager often requests reports on specific product categories or price ranges. 

To generate these reports, you typically go through a laborious process:

  • Manually filter the spreadsheet by selecting the desired criteria from the filter menu.
  • Manually sort the filtered results to organize the data as needed.
  • Copy and paste the data into a new sheet to create the report.
  • Repeat this process multiple times for different categories and criteria.

This manual work consumes valuable time and leaves room for errors, especially when dealing with large datasets. But you can simplify this ordeal with the power of buttons. 

In the subsequent sections, we will discuss why anyone would want to make a button in Google Sheets. Not just that, we will show you how to make a button in Google Sheets.

Why Make a Button in Google Sheets?

In Google Sheets, making colorful buttons isn’t just about making your sheet look nice – it’s also about adding unique functionalities to your spreadsheets. Let’s look at reasons that might compel anyone to make a button in Google Sheets.

1. Simplify Tasks with One Click: By creating buttons, you can connect them to special mini-programs called scripts or macros. When you click the button, it runs the script or macro automatically. This can save you a ton of time, especially if you have tasks you must do repeatedly.

2. Put Buttons Where You Need Them: You can put these buttons anywhere in your sheet. Placing them next to the parts of your spreadsheet where they’ll be most helpful is a smart move. This means you can tackle tasks quickly and easily, right when you need them. It’s like having shortcuts that you design yourself.

Simply put, creating buttons in Google Sheets isn’t just for looks – it’s a practical way to make your life easier, save time, and stay organized. 

Creating a Button in Google Sheets: The Step-by-Step Guide

As we delve into making buttons in Google Sheets, we’ll take a step-by-step approach to guide you through this exciting process. We’ve discussed why these buttons matter, and now it’s time to roll up our sleeves and get hands-on.

Before we embark on this adventure, let’s familiarize ourselves with the sample data we’ll use to teach you how to create a button in Google Sheets. Think of it as setting the stage for our journey into the world of spreadsheet buttons. 

Objective: Our objective with this step-by-step guide is to show you how to create buttons in Google Sheets. These buttons, when clicked, will automate various tasks like filtering and sorting, thus simplifying data management. 

By the end of this tutorial, you’ll have the skills to make your spreadsheets more efficient and user-friendly by adding these interactive buttons.

Copy Sample Sheet

To follow along with this tutorial, you will need some sample data. We have provided sample data that you can copy here:

Click Here to Copy The Sample Sheet

If you already have your own data to use, that’s great! You can simply replicate the steps we will show using your own data instead of the sample. The process will be the same.

Let’s get started

Now that we have our sample data, let’s dive into the exciting world of Google Sheets buttons. 

In this step-by-step guide, we will walk you through the process of creating a button and using it to automate tasks in your spreadsheet.

Step 1: Open Google Sheets

Let’s start by opening the Google Sheets documents housing the data we want to use to make a button in Google Sheets. 

If you’re following along, you can simply copy our sample data and follow the steps we will detail shortly. 

Step 2: Select a Blank Cell

Now that the sheet you want to use to make a button in Google Sheets is opened, select a blank cell. This is where you want your button to appear. For this tutorial, we will select cell F4. 

Step 3: Create the Button

Having picked the cell where you’d like your button to appear, let’s move on to the exciting part – actually making the button.

Here’s what you need to do:

  • Go to the “Insert” menu. You’ll find it at the top of your Google Sheets screen.
  • Once you’re in the “Insert” menu, you’ll see a bunch of choices. Don’t worry; we’ll guide you through it.
  • Look through these options and find the one labeled “Drawing.” When you select that option, Google Sheets should launch the drawing window, where the magic happens. 

The drawing window should look something like this: 

Step 4: Draw the button

With the drawing window now launched, let’s quickly draw our button. Typically, we want to navigate to the toolbar section of our drawing window and click on the option for Shape. 

When you click on the “Shape” option, you’ll see various shapes you can use to create your button. It’s like picking the perfect puzzle piece for your masterpiece. But for this guide, let’s keep it simple.

We’re going to choose the “rectangle” shape. 

After selecting a rectangle as the shape we want for our button, Google Sheets should add that shape to our drawing window. It should look something like this: 

Step 5: Customize Shape

Having added the button shape to the drawing window like we showed you in the previous step, let’s quickly customize the button to make it look even better.  

First, we want to name the button. To do that, double-click the shape and enter Filter as the button’s name. 

The button should look like this:

After naming the button, we also want to change the button color. To do that, click on the fill handle. This action will reveal several colors you can use for your button. For this example, we will go with the color green. 

Once you choose the color for your button, Google Sheets automatically changes the color to match your selection. 

Here is what our button looks like after changing the color to green. 

Step 6: Save Changes

With our button now created and customized to our liking, it’s time to save the changes so our button can reflect in our spreadsheet. To save the changes, simply navigate to the top of the drawing window and select the option for Save and Close. 

By selecting this option, Google Sheets will automatically save your changes and add the button to your spreadsheet. 

After saving the changes as we showed you, here is what our button looks like in our spreadsheet. 

Step 7: Extensions > Apps Script

Our button looks fantastic, but it’s just a pretty face at the moment. It’s time to make it do something useful.

To make our button actually do things, we’ll assign a script to it. Think of a script as the magic spell that brings your button to life. Let’s go ahead and do just that.

Navigate to the Extensions menu and select the option for Apps Script. With this option selected, Google Sheets will automatically launch the Apps Script editor

Step 8: Add Script

After the Apps Script editor launches, all you need to do is click on the script editor window and type in the following script: 

function filterElectronics() {

var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();

var data = sheet.getRange("B5:B12").getValues();

for (var i = 0; i < data.length; i++) {

if (data[i][0] !== "Electronics") {

sheet.hideRows(i + 5); // Adjusted to match the range starting from B5.




What this script essentially does is filter our data based on Electronics under the column for category. 

Step 9: Save Script

Now that you’ve added the script, as we explained, let’s make sure to save your hard work. Here’s how to do it:

Look at the top of your Apps Script editor; you’ll see a little icon resembling a tiny, old-school floppy disk. Click on it.

When you click that icon, your script is saved. 

Step 10: Assign Script

With our script now saved, it’s time to assign the script to our button, which is super easy. To assign a script, simply click on the button you created. 

You should see a three-dot icon. Click on that icon to reveal several options. From the options you see, select the one that says Assign Script. 

Once you choose the option for Assign script, you should see a pop-up box. This is where you’ll enter the script’s name we saved earlier. 

For this example, we will assign the script name “filterElectronics.”

Step 11: Test Button

Now that we’ve connected our script to the button, it’s time to give it a spin and see if it does its job the way it’s supposed to.

Here’s what we need to do to put the button through its paces. First, we need to click on the button. This action triggers the script, ensuring that it runs behind the scenes. 

Once it’s done running, your spreadsheet should be instantly filtered to display only results for electronics. 

For a visual treat, check out the video below. It’ll show you how smoothly our button does its thing when it gets the call to action.

If you followed us right from the get-go, we are sure you now know how to make a button in Google Sheets. And you know the best part? We even took things up a notch by showing you how to assign functionality to your button. 

For starters, the power of buttons lies in their ability to simplify complex operations and make your spreadsheets more interactive.

If you have ever wondered why anyone would make a button in Google Sheets, we are sure today’s guide has given you more than enough reasons to explore and experiment with buttons in Google Sheets. 

Using a button will remarkably streamline your data management and enhance your Google Sheets experience.

Final Thoughts

Congratulations on mastering the art of creating buttons in Google Sheets. You’ve come a long way. Now it’s time to sum it all up.

Here is everything we achieved in today’s tutorial. 

Button Creation: We started by showing you how to create a button in Google Sheets. We gave you a detailed breakdown, ensuring that even someone getting started with Google Sheets can make a button without stressing. 

Script Assignment: Because buttons are designed to be functional, we took things up a notch by showing you how to assign a script to your button. The goal of this was to ensure our button performs a function every time it is called into action. 

Button Testing: We didn’t leave things at just assigning the script to our button. We also needed to know that it works. So we put it to the test, and viola, it did exactly as we wanted it to. 

Overall, here is what you should know. Buttons are more than just decorations. They’re tools that can streamline your work, making Google Sheets a powerhouse for managing data. With buttons, you can automate tasks, sort data, filter results, and much more, all at the click of a button.

Feel free to experiment and customize buttons for your unique needs. Whether it’s managing inventory, generating reports, or simplifying data analysis, buttons are your friends in Google Sheets.

We hope today’s guide has been most helpful, especially for someone just getting started with buttons in Google Sheets.