Skip to main content

How to Set Up Named Ranges in Excel


 - Instead of using something like = SUM(A2:A5) to add up a column of numbers, you can replace the A2:A5 part of the function with a more descriptive name. This is known as a Named Range. Examine the spreadsheet below:
Adding up columns of figures
In the Results Row, cell B5 is a result of adding up cells B2 to B4. The formula used is just this:
=Sum(B2:B4)
Now examine the same spreadsheet, but with a Named Range used:
The SUM is using a named Range
This time, cell B5 doesn't have in it the formula = Sum(B2:B4). As you can see, it has =SUM(Monthly_Totals). This is the label from B1. We have created a Named Range. The formula in cell B5 is now more descriptive. We can tell at a glance what it is we're adding up. Excel has replaced the B2:B4 part with the name we gave it. Behind the scenes, though, we're still adding up the numbers in cells B2 to B4. Excel has just hidden the cell references behind our descriptive name. 
You'll now see how to create your own Named Ranges.

Creating a Named Range

Start a new spreadsheet, and enter the same data as in the image below:
Create this spreadsheet
Make sure you have the same formula in cell B5 =Sum(B2:B4). We're going to create a Named Range, and then pop it in cell B5. To create a Named Range then, do the following:
  • Highlight the B column, from B2 to B4 (Don't include the formula when you're highlighting. Just highlight the same cells as the ones in the function)
  • From the menu bar, click on Insert
  • From the drop-down menu select Name
  • A sub menu appears like the one below:
There's a two-step process involved with setting up a Named Range. The fist thing to do is Define the name. You then Apply the name to your formula.
  • So select Define from the sub menu
  • The Define Name dialogue box pops up. This one:
The Define Name dialogue box
With the B column highlighted, Excel will use your label at the top as the name (Monthly_Totals for us). But you can change it if you want. Notice the narrow text box at the bottom, "Refers to". This is showing the highlighted cells.
Click OK on the dialogue box.
You are returned to your spreadsheet. Nothing will happen. This is because we have haven't done step two of the two-step process - Applying the name.
To apply your new name to a formula, do this:
  • Click inside the cell where your formula is, B5 in our case
  • Click on Insert from the menu bar
  • From the drop down menu, select Name
  • From the sub menu that appears, click on Apply
  • A dialogue box will appear showing a list of all the Names you have set up
You'll have only one Name set up , so there's not much to do except click the OK button.
When you click OK, Excel should adapt your formula in cell B5. If you've done it right, your spreadsheet should look like the one below:
The Named Range is in cell B5
As you can see, the cell B5 now reads =SUM(Monthly_Totals). Excel has hidden the cell references behind the Name we defined.
If you didn't get the Name, but instead got the error message below, then there are a couple of things you can do:
Before you click Insert > Name > Define, make sure you highlight only the same cells as the ones in your formula. Make sure that there is a formula in the cell B5, and that it says = SUM(B2:B4)
We can enter another Named Range for our Monthly Tax column, column C. Here's a break down of the Two-Step process involved with setting up a Named Range.
Step One - Define the range of cells
  • Enter your Formula (In cell C5, enter = SUM(C2:C4))
  • Highlight the same cells that are going in your formula
  • From the menu bar, click Insert > Name > Define
  • From the Define Name dialogue box, either accept the name Excel gives you, or type your own name for the range of cells you're going to define
  • Click OK
Step Two - Apply the Name
  • Click inside the cell where the formula is (cell C5 for us)
  • From the menu bar, click Insert > Name > Apply
  • From the Apply Name dialogue box, click on the Name you want to use
  • Click OK
  • Excel will insert the name, if it can, and hide your cell references behind the name
So go ahead and insert a Named Range for cell C5. When you're finished, the spreadsheet should look like the one below:
As you can see, cell C5 no longer reads = Sum(C2:C4). Instead, we have a Named Range in cell C5.

In the next part, we'll see how to use the Named Ranges you have just set up.

Comments

Popular posts from this blog

Beginners PHP  -This is a complete and free PHP programming course for beginners. It's assumed that you already have some HTML skills. But you don't need to be a guru, by any means. If you need a refresher on HTML, then click the link for the Web Design course on the left of this page. Everything you need to get started with this PHP course is set out in section one below. Good luck! Home Page > PHP Section One - An Introduction to PHP 1. What is PHP and Why do I need it? 2. What you need to get started 3. Installing and testing Wampserver 4. Troubleshooting > PHP Two - Getting Started With Variables 1. What is a Variable? 2. Putting text into variables 3. Variables - some practice 4. More variable practice 5. Joining direct text and variable data 6. Adding up in PHP 7. Subtraction 8. Multiplication 9. Division 10. Floating point numbers > PHP Three - Conditional Logic 1. If Statements 2. Using If Statements 3....
Visual Basic .NET Contents Page   -This computer course is an introduction to Visual Basic.NET programming for beginners. This course assumes that you have no programming experience whatsoever. It's a lot easier than you think, and can be a very rewarding hobby! You don't need to buy any software for this course! You can use the new FREE Visual Basic Express Edition from Microsoft. To see which version you need, click below: Getting the free Visual Studio Express - Which version do I need? > VB .NET One - Getting Started   1. Getting started with VB.NET 2. Visual Basic .NET Forms 3. Adding Controls using the Toolbox Home Page 4. Adding a Textbox to the Form 5. Visual Basic .NET and Properties 6. The Text Property 7. Adding a splash of colour 8. Saving your work 9. Create a New Project >   VB .NET Two - Write your first .NET code   1. What is a Variable? 2. Add a coding button to the Form 3. Writing y...
The Excel SumIF Function  - Another useful Excel function is SumIF. This function is like CountIf, except it adds one more argument: SUMIF( range ,  criteria ,  sum_range ) Range and criteria are the same as with  CountIF  - the range of cells to search, and what you want Excel to look for. The Sum_Range is like range, but it searches a new range of cells. To clarify all that, here's what we'll use SumIF for. (Start a new spreadsheet for this.) Five people have ordered goods from us. Some have paid us, but some haven't. The five people are Elisa, Kelly, Steven, Euan, and Holly. We'll use SumIF to calculate how much in total has been paid to us, and how much is still owed. So in Column A, enter the names: In Column B enter how much each person owes: In Column C, enter TRUE or FALSE values. TRUE means they have paid up, and FALSE means they haven't: Add two more labels: Total Paid, and Still Owed. Your spreadsheet should look something li...