Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 07-25-2009, 05:49 AM
staples staples is offline
Registered User
 
Join Date: 22 Nov 2008
Location: house
Posts: 68
staples is becoming part of the community
Dynamic range to update chart, multiple series

Please Register to Remove these Ads

Hi there

I am creating a line chart with 2 series from seperate sheets. Each chart is populated from a single row on each sheet. Each sheet has the same account numbers running down column A. The date runs across row 1 in each sheet. One sheet shows, lets say, cash and the other cheque.

A chart needs to be created for many of these accounts so I am therefore, trying to automate this process a little. I have found a way to do this using dynamic ranges and a macro, however this only works for single series charts.

The only way I can get this to work for charts with two series is if the account numbers are in the exact same order in both sheets.

I have attached the file, any help would be much apprieciated
Thanks
Attached Files
File Type: xls Book1.xls (38.0 KB, 8 views)

Last edited by staples; 07-31-2009 at 02:30 PM.
Reply With Quote
  #2  
Old 07-25-2009, 07:22 AM
Andy Pope's Avatar
Andy Pope Andy Pope is offline
Forum Guru
 
Join Date: 10 May 2004
Location: Essex, UK
MS Office Version:2003 & 2007 sp2
Posts: 7,187
Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding
Re: Dynamic range to update chart, multiple series

You need to alter the named ranges slightly so the Row offset value is also dynamic based on the result of a MATCH formula.

I have add a data validation cell to the cash sheet that allows you to pick the account to report. The same cheque report is done on the other sheet.
Attached Files
File Type: xls 692970.xls (39.0 KB, 13 views)
__________________
Cheers
Andy
www.andypope.info
Reply With Quote
  #3  
Old 07-25-2009, 08:31 AM
staples staples is offline
Registered User
 
Join Date: 22 Nov 2008
Location: house
Posts: 68
staples is becoming part of the community
Re: Dynamic range to update chart, multiple series

Hi Andy

Thanks for the reply, that is working great
Could I just ask, would there a be way to automatically update the chart when I added a new days worth of data in the end column?

Thanks again
Rich

Last edited by staples; 07-25-2009 at 08:38 AM.
Reply With Quote
  #4  
Old 07-25-2009, 09:16 AM
staples staples is offline
Registered User
 
Join Date: 22 Nov 2008
Location: house
Posts: 68
staples is becoming part of the community
Re: Dynamic range to update chart, multiple series

Hi again,

Sorry to keep pounding you with questions!

I was wondering would this method still work for thousands of rows of data? On the example I only listed a basic 8 account however I will often have thousands of rows to work through.

Would it still be achvieable through this method or do you perhaps know of any
other way?

The method I found was using a macro which, when you double clicked an account in the Cash Data sheet, it would update the chart, however I couldn't figure out how to link to correctly to the cheque sheet like you managed to do.

Thanks
Rich
Reply With Quote
  #5  
Old 07-25-2009, 09:37 AM
Andy Pope's Avatar
Andy Pope Andy Pope is offline
Forum Guru
 
Join Date: 10 May 2004
Location: Essex, UK
MS Office Version:2003 & 2007 sp2
Posts: 7,187
Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding
Re: Dynamic range to update chart, multiple series

The named range doesn't require the +1 as the Match formula does not include A1 in the source range.

=OFFSET(CASHDATA!$A$1,CASHDATA!$D$21,1,1,10)

You can add extra days by using a formula to count the number of days in rows.

=OFFSET(CASHDATA!$A$1,CASHDATA!$D$21,1,1,Counta(1:1)-1)

And you can adjust the match forumla to include a larger range.
__________________
Cheers
Andy
www.andypope.info
Reply With Quote
  #6  
Old 07-30-2009, 04:44 PM
staples staples is offline
Registered User
 
Join Date: 22 Nov 2008
Location: house
Posts: 68
staples is becoming part of the community
Re: Dynamic range to update chart, multiple series

I have been having a play around and still having a few problems if anyone could please help me out.

The problem I have is that because I am wanting to use two series in my chart, when I use the index formula the series aren't always linking to the same account. As the index is based on a row number, if one table has more or less accounts than the other, then the index formula selects the wrong account and therefore displays the wrong data on the chart.

The chart does show 2 series however, one line if for a particular account and the other line is for differnt account.

I am unsure how to grab the correct data for each series. I know vlookups are useful for this, however I do not know if it can be achieved in that manner.

It's a little tricky to explain in words I'm affriad so have attached my most recent worksheet.

Thanks again
Rich
Attached Files
File Type: xls 2 Series Chart.xls (30.5 KB, 3 views)
Reply With Quote
  #7  
Old 07-31-2009, 04:25 AM
Andy Pope's Avatar
Andy Pope Andy Pope is offline
Forum Guru
 
Join Date: 10 May 2004
Location: Essex, UK
MS Office Version:2003 & 2007 sp2
Posts: 7,187
Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding Andy Pope Has a higher level of understanding
Re: Dynamic range to update chart, multiple series

The index value in B1 is the index for the data on sheet Account01.
You need to create an index value for the data on sheet Account02.

In ChartData!G1 use this formula

=MATCH(INDEX(Account01!A2:A44,B1,1),Account02!A2:A41,0)

And change the references to $B$1 in row 4 to $G$1

note you will get a few #N/A records as there is not a 100% match between the 2 lists.
Attached Files
File Type: xls 692970b.xls (30.5 KB, 11 views)
__________________
Cheers
Andy
www.andypope.info
Reply With Quote
  #8  
Old 07-31-2009, 12:26 PM
staples staples is offline
Registered User
 
Join Date: 22 Nov 2008
Location: house
Posts: 68
staples is becoming part of the community
Re: Dynamic range to update chart, multiple series

Working perfect!

Thanks
Rich
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump