Solved

dynamic range in chart

Posted on 2011-03-07
3
386 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 81

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 81

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

738 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