Search Contextures Sites ![]()
Excel Names -- Use Range Names in Formulas
Create a Table
Create the first Dynamic Range
Create the remaining Dynamic Ranges
Create the Date Range selection cells
Create the Summary formulas
Create the Chart
Test the Chart
You can use a dynamic formula to define a range. As new items are added, the range will automatically expand.
In this example, dynamic range names are used in formulas that summarize a list of sales records, and a chart is based on the result. When new records are added, or a different date range is selected, the chart is immediately updated.
Download the zipped Excel Names sample file
Create a Table
- In a new workbook, delete all except two worksheets.
- Rename Sheet1 as SalesData
- Rename Sheet2 as Chart
- On the SalesData sheet, in cells A1:D1, add the headings, Date, Item, Colour, Units, as shown at the right.
- Enter sample data in each column, or use the data in the zipped Excel Names sample file.
Create the Date Range selection cells
Use Data Validation to create dropdown lists for the chart start and end dates.
- On the Chart sheet, select cells C2 and E2.
- Choose Data | Validation
- From the Allow dropdown, choose List
- In the Source box, type: =DateList
- Click OK
- Add a border to the cells, to highlight them.
- Select a sample date in each list, to be used in the Summary formulas.
- Format the dates as desired (Format | Cells, Number tab)
Create the Summary formulas
Use the SUMPRODUCT function to total the sales for each colour.
- On the Chart sheet, in cells B15:B18, type the list of colours sold.
- In cell C15, enter the following formula:
=SUMPRODUCT(--(ColourList=B15),(UnitsList),--(DateList>=$C$2),--(DateList<=$E$2))- Copy the formula down to row 18.
Test the Chart
- From the Date Range selection cells, select different dates.
- The chart should update immediately, to reflect the new date range.
For more information on Excel Charts, see Jon Peltier's site.
Download the zipped Excel Names sample file
1. Excel Names -- Naming Ranges
2. Excel Names -- Using Range Names in Formulas
3. Excel Names -- Create Dynamic Ranges With a Macro
Contextures Inc., Copyright © 2009.
All rights reserved.
Last updated: February 6, 2010 11:45 PM