In this article:

How to Create a Google Sheets Variable (2024 Guide)

How to Create Google Sheets Variables

In Google Sheets, variables are commonly created as "named ranges." This allows you to assign a memorable name to a specific cell or range of cells instead of using standard cell references like A1 or B2:B6. Here's how to create a named range:

1. Select the cell or range of cells you want to name.

This can be a single cell, a group of cells, or a range that you frequently reference in your formulas.

Below is a sample data set:

google sheets variable

2. Open the sidebar for named ranges.

Navigate to the menu: Data > Named ranges.

google sheets variables

3. Enter a name for your range in the text field provided. 

This name will act as your "variable." Choose a name that is easy to remember and reflects the data or value it represents.  In our example, we have "SalesData." Confirm by clicking Done.

create google sheets variables


Once you have created a named range, you can use it in your formulas by typing the name you assigned to it. For example, if you named a range "SalesData," you could use it in a SUM formula like so:


how to use google sheets variables

We hope that this article has helped you and given you a better understanding of how to create and use a Google Sheets variable using named ranges. If you enjoyed this article, you might also like our articles on how to highlight distinct values in Google Sheets and how to force Google Sheets to recalculate.

Automate repetitive tasks with Lido

Save hours on repetitive and tedious work. Lido is a new spreadsheet that connects your spreadsheets, forms, PDFs, and email inbox.

Select trigger
When a cell value in Google Sheets changes
Check Google Sheets for today's date
When a new row is added to Google Sheets
On new Google Form submission
Send me a daily reminder
On new Typeform submission
When a cell value in database changes
Check database for today's date
When a new row is added in database
When a new HubSpot customer is created
Select action
Creates a one- or multiple-day calendar event with optional attendees
Adds an object to Hubspot
Create a Slack channel, and optionally add a topic or members
Makes any HTTP request
Replaces [@column_name] values in a Google Doc with the corresponding table row's values
Replaces [@column_name] values in a Google Doc with the corresponding table row's values, then export it as a PDF
Makes any HTTP request and returns the response
Inserts given array below defined values in given worksheet
Sends an email using your Google account
Sends an email using your Microsoft Outlook account
Sends a Slack message
Sends an SMS message using your Twilio account
Updates cells with given values
Updates a property of a Hubspot object
Trigger is required
Action is required
Get started