What a variable is and why Excel calls it something else
In Excel, a variable is a named reference to a cell or range of cells. Instead of typing a cell address like B5 every time you need that value, you give it a name like "TaxRate" or "MonthlyRent" and use the name instead. Excel calls this a named range or defined name.
Named ranges make your formulas easier to read and harder to break. If you write =B5*C5 and later insert a column, that formula breaks. If you write =Price*Quantity, the formula still works no matter what you move around. They also reduce the chance you'll reference the wrong cell by accident, since you're using a meaningful word instead of guessing whether the number is in column B or column D.
This matters for security because clearer formulas are easier to audit. If someone needs to check whether your spreadsheet calculates something correctly, a formula that says =NetIncome*TaxRate is faster to verify than one that says =E47*F12, and faster verification means fewer mistakes slip through.
Key Takeaways
- A named range in Excel is a word or phrase you assign to a single cell or group of cells so you can reference it by name instead of by cell address.
- You create a named range by selecting the cell or cells, then typing a name in the Name Box (the field to the left of the formula bar) and pressing Enter.
- Named ranges make formulas readable and protect them from breaking if you insert or delete rows and columns later.
- You can manage all your named ranges in one place using the Name Manager, which you open from the Formulas tab (Windows) or Sheet menu (Mac).
- A named range can refer to a single cell, a row, a column, or any rectangular block of cells, but not to cells scattered in different places.
Creating a named range the quick way
The fastest way to create a named range is through the Name Box. Click on the cell you want to name — for example, the cell that holds your hourly wage. Look at the top left of your screen, just above row 1 and to the left of the formula bar. You'll see a box with the current cell address (like "B3"). Click on that box, type your new name (like "HourlyWage"), and press Enter.
Excel accepts names that start with a letter or underscore, contain letters, numbers, and underscores, and do not contain spaces. If you want a name that reads like two words, use HourlyWage or Hourly_Wage, not Hourly Wage. Names are not case-sensitive — HourlyWage and hourlywage refer to the same range — but Excel preserves the case you type.
Once you've created the name, you can use it in any formula in that workbook. Type =HourlyWage*40 to calculate weekly pay, or =HourlyWage*52*40 to estimate annual earnings. The formula will calculate using whatever value is in that cell, even if you move the cell later.
Naming a range of multiple cells
You can also assign a name to a group of cells. Select the range first — click on the starting cell, hold Shift, and click on the ending cell. Or click and drag from the first cell to the last. Then use the Name Box the same way: click it, type the name, and press Enter.
For example, if cells B2 through B13 contain your monthly expenses, select that range and name it "MonthlyExpenses". Now you can write =SUM(MonthlyExpenses) instead of =SUM(B2:B13). If you add a new expense in row 14 later, you'll need to update the range, but the formula itself stays the same.
A named range must be rectangular — it can be a single row, a single column, or a block of rows and columns, but not cells scattered in different places. If you need to reference non-adjacent cells, create separate named ranges for each group.
Using the Name Manager to see and edit all your names
As you create more named ranges, you may forget what you named or want to change a name later. The Name Manager shows you every named range in your workbook in one place.
On Windows, open the Name Manager by clicking the Formulas tab, then clicking "Name Manager" in the Defined Names group. On a Mac, click the Sheet menu and select "Named Ranges and Expressions" > "Define". A dialog box opens showing every named range, what cells it refers to, and what scope it has (whether it applies to the whole workbook or just one sheet).
In the Name Manager, you can click on any name to see which cells it refers to. You can also click "Edit" to change the name or the range it points to, or click "Delete" to remove a name you no longer need. If you delete a named range, any formula using that name will show a #NAME? error, so be careful.
Scope: workbook-level names versus sheet-level names
When you create a named range, it applies to the entire workbook by default. That means you can use the name "TaxRate" in any formula on any sheet in that file. This is usually what you want.
You can also create a sheet-level name that only works on one specific sheet. This is useful if you have multiple sheets with similar data and want to use the same name on each sheet without confusion. To create a sheet-level name, open the Name Manager, type the name as SheetName!NameHere (for example, "January!DailyTotal"), and set the scope to that sheet.
Most of the time, stick with workbook-level names. They're simpler and less likely to cause confusion when you're sharing the file or coming back to it months later.
When named ranges break and how to fix them
A named range can break if you delete the cells it refers to. If you name cell B5 as "TaxRate" and then delete column B, the named range still exists but points to nothing. Any formula using TaxRate will show #REF! error.
To fix this, open the Name Manager and either delete the broken name or edit it to point to the correct cells. You can also prevent this by being careful when deleting rows or columns — if you're not sure whether a name refers to that area, check the Name Manager first.
Another common problem is typing a name wrong in a formula. If you type =HourlyWage*40 but the actual name is HourlyWages (plural), Excel shows #NAME? error. The formula bar will highlight the misspelled name in red. Check the Name Manager to see the exact spelling and retype it correctly.
Named ranges and security: what they protect and what they don't
Named ranges make your spreadsheet more transparent and easier to audit, which supports security by making it harder to hide a formula or reference by accident. A formula that says =NetIncome*TaxRate is obviously calculating tax; a formula that says =E47*F12 could be doing anything, and someone reviewing your work has to click on each cell to understand it.
Named ranges do not encrypt your data or prevent someone from seeing the cells they refer to. Anyone who opens your file can see the named ranges in the Name Manager and can click on a formula to see what cells it uses. If you need to protect sensitive data, use Excel's password protection or encryption features instead.
If you're sharing a spreadsheet with others, named ranges make collaboration easier because people can understand your formulas without asking you what B5 means. This reduces the chance of someone accidentally changing the wrong cell or misunderstanding how a calculation works.
Frequently Asked Questions
Can I use a named range in a formula on a different sheet?
Yes, if the named range is workbook-level (the default). You can type =Sheet1.HourlyWage or just =HourlyWage from any sheet. If the name is sheet-level, you can only use it on that sheet. Check the Name Manager to see the scope of each name.
What happens if I rename a cell that's used in a formula?
The formula automatically updates to use the new name. If you rename B5 from "TaxRate" to "StateTaxRate", any formula that said =TaxRate*Income now says =StateTaxRate*Income. The calculation doesn't change, only the name in the formula.
Can I name a cell with a formula in it?
Yes. You can name any cell, whether it contains a number, text, or a formula. The name refers to the cell itself, not to what's in it. If the cell's value changes, the name still refers to that cell and uses the new value.
How do I delete a named range?
Open the Name Manager (Formulas tab on Windows, Sheet menu on Mac), click the name you want to remove, and click Delete. Any formula using that name will show #NAME? error, so search your spreadsheet first to make sure you're not breaking anything.
Can I export or copy named ranges to another workbook?
Named ranges are stored in the workbook where you create them and don't transfer automatically. You can recreate them in a new file by opening the Name Manager in both files and typing the names and ranges again, or by copying the sheet that contains the names to the new workbook.