In this article:

How to Create a Google Sheets Variable (2024 Guide)

December 5, 2024

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

Example

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:

=SUM(SalesData)

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.

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->