Dynamic Named Ranges
The power of Dynamic Named Ranges cannot be underestimated. They allow a calculation or list of information to be updated automatically when information is added or deleted. I mostly use them when creating validation listboxes but they can alos be used very effectively in formulas and graph source data.
In order to create a dynamic Named Range it is necessary to utilise the 'offset' function in the 'Refers to' textbox in the Define Name dialog box.
Example - dynamic Named Range
In order to create a dynamic Named Range it is necessary to utilise the 'offset' function in the 'Refers to' textbox in the Define Name dialog box.
Example - dynamic Named Range
- Insert Menu - > Name -> Define
- This will bring up the Define Name dialog
- Enter the name you wish to call your Named Range in the Names in workbook textbox
- In the refers to textbox, enter the following formula
- From cell A2, select all cells in column A that are not blank minus 1 (to exclude the heading)
- You could substitute "<>" for ">0" (greater than 0) or any other criteria you chose.
- If you delete or enter another name from the list then the Named Range will automatically include it in the selection
- In a formula
- Data validation 'List'
- Chart Source information - for example, it is March, so only 3 months of Sales have been recorded but unless you change the source selection of the chart each month, the graph will show all the months up to December (even though they haven't occurred yet). Why not enter a Named Range as the Source data so that it automatically picks up the 'current' sales (up to and including March)
=OFFSET(Sheet1!$A$2,0,0,COUNTIF(Sheet1!$A:$A,"<>")-1)
Information about the formula/function
Where this could be used