Solved

dynamic range in chart

Posted on 2011-03-07
3
375 Views
Last Modified: 2012-05-11
Hello,

I have defined two ranges with the names: datePnL and DailyPnL

and formulas:
=DailyPnL!$H$4:OFFSET(DailyPnL!$H$4;0;0;COUNTA(DailyPnL!$H:$H)-2;0)

=DailyPnL!$I$4:OFFSET(DailyPnL!$I$4;COUNTA(DailyPnL!$I:$I)-2;0)

I am having a problem inputting the ranges correctly into the series bar of a chart. I have included a worksheet as an example. Can you either create a bar chart for me or instruct me on how to do it. I have tried and even got the PnL column to work but not the date column and therefore the chart would not update dynamically.
Thanks.
Chris
 Example-Dynamic-Chart.xlsx
0
Comment
Question by:CC10
  • 2
3 Comments
 
LVL 80

Accepted Solution

by:
byundt earned 250 total points
ID: 35060661
Change your named range definitions to:
=DailyPnL!$H$4:OFFSET(DailyPnL!$H$4,COUNT(DailyPnL!$H:$H)-1,0)
=DailyPnL!$I$4:OFFSET(DailyPnL!$I$4,COUNT(DailyPnL!$I:$I)-1,0)

Click on the series in the chart, then modify the formula in the formula bar to:
=SERIES(DailyPnL!$I$3,'Example-Dynamic-Chart.xlsx'!DatePnL,'Example-Dynamic-Chart.xlsx'!DailyPnL,1)
0
 
LVL 80

Expert Comment

by:byundt
ID: 35060750
There are other constructions possible for your named range definitions:
=OFFSET(DailyPnL!$H$4,0,0,COUNT(DailyPnL!$H:$H),1)
=DailyPnL!$H$4:INDEX(DailyPnL!$H$4:$H$1000,COUNT(DailyPnL!$H$4:$H$1000))      'My favorite because it is not volatile

You need to enclose the name of the workbook in single quotes when using the named range in your series definitions. Excel requires either the Sheet name or Workbook name preceding the named range name.
Example-Dynamic-ChartQ26869132.xlsx
0
 

Author Closing Comment

by:CC10
ID: 35061085
Thanks very much
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now