Module 1 - Applied Named Formulas: Invoice 2 TOPICS COVERED: 1) Setting up Named Ranges (0:00) 2) The Apply Names Function (3:15) 3) Examining Named Formulas Using the Name Manager (4:20) 4) Creating a Named Formula that is NOT a Reference (6:00) 5) Array Nature of Named Formulas (9:10) 6) Dynamic Ranges (10:40) 7) Purpose of This Tutorial (15:20) Setting up Named Ranges (0:00) Continuing on with the Invoice worksheet, we set up several basic Named Ranges. LineTotals, Subtotal, Tax, TaxRate, and GrandTotal. Module 1 - Applied Named Formulas: Invoice 2-1
The Apply Names Function (3:15) Selecting the values with formulas in them, you can use a neat function of Excel to Apply Names of the newly created named ranges so that they replace the "naked" cell ranges in the formulas. Module 1 - Applied Named Formulas: Invoice 2-2
The Effect of Applying Names Select all the names you wish to apply and click 'OK'. You will notice the following updates to the cell formulas... D2 (Subtotal) =SUM(LineTotals)... no longer the sum of a naked range, but it is the sum of a named range. D3 (Tax) =TaxRate*Subtotal... much more meaningful than =B3*D2 D4 (GrandTotal) =Subtotal+Tax... again, much more meaningful than =D2+D3 Module 1 - Applied Named Formulas: Invoice 2-3
Examining Named Formulas Using the Name Manager (4:20) Press Ctrl+F3 to open up the Name Manager. (1) Each Named Range is a simple formula that points directly to a range, but does nothing else. Notice the Refers To column. Each consists of an equals sign and a range reference. (2) Notice that the value of a Named Range is an array. In fact, they are all arrays, but Excel simplifies the look if there is only one element in the array. (3) Each named range has a "Scope" set to "Workbook". *** ALL NAMED FORMULAS ARE ARRAYS *** Module 1 - Applied Named Formulas: Invoice 2-4
Scope of Named Formulas If you want to limit the scope to a particular worksheet... you cannot use the Name Box to create it. Instead, you have to use the New Name Dialog. In fact, you cannot even edit the scope of an existing name if it was created using the Name Box. Notice the scope will be greyed out. Module 1 - Applied Named Formulas: Invoice 2-5
Creating a Named Formula that is NOT a Reference (Example 1) (6:00) (1) Change "TaxRate" to a Named Constant. Notice the Refers To is not a range. (2) And notice when clicking on cell B3, we do not see the Named Range in the Name Box, because "TaxRate" is now a Named Constant. Both Named Ranges and Named Constants are simply Named Formulas. Module 1 - Applied Named Formulas: Invoice 2-6
Creating a Named Formula that is NOT a Reference (Example 2) Named Formulas are potent and robust feature of Excel. Essentially, any formula you can devise can be named. And the logic can be built up in layers... For example... GrandTotal is serving no point, pointing to D4, the grand total of the invoice... Instead, Let's change it to reference the formula that actually produces the grand total... or, Subtotal + Tax. Module 1 - Applied Named Formulas: Invoice 2-7
Creating a Named Formula that is NOT a Reference (Example 2 cont.) --> where the Named Formula GrandTotal is equal to Subtotal+Tax. Array Nature of Named Formulas (9:10) Module 1 - Applied Named Formulas: Invoice 2-8
Add the following named ranges: Column A --> Quantity Column D --> UnitPrice Each line total now has the same formula... Quantity*UnitPrice. Every formula is identical. Recognize that this is the array nature of Named Formulas. Dynamic Ranges (10:40) The technique is referred to as a dynamic range. It's not so much that the range is dynamic then the formula is intelligent enough to return the proper range. (the formula creation will be explained in detail later in the course) (1) By clicking into the "Refers to:" formula box... (2)...we can see that Excel selects the correct area in the worksheet. And when new rows are added below row 15, those new rows will be correctly included in our Subtotals. Module 1 - Applied Named Formulas: Invoice 2-9
Another Instance of a Dynamic Range We can now update the LineTotals formula so it no longer points to a naked range reference. Now it uses an INDEX function that will refer to the correct range when called upon. Purpose of This Tutorial (15:20) This was just a peek at the power of Named Formulas. Eliminate the levels of abstraction (references to naked ranges) when working with Named Formulas. Module 1 - Applied Named Formulas: Invoice 2-10