Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 192
Default link a chart source to a cell reference

Hi, lets say i have a cell A1 that shows the text B1:B5, and i have a cell A2
that shows the text C1:C5. Then i want to have a chart that references cells
A1 and A2, and hence knows that i want it to chart the data in arrage B1 to
C5 (an x-y scatter plot). the point being the text values in cells A1 and A2
might change, and i want to the chart to automatically update and plot the
new ranges specified. i can't work out how to do this. is it possible?

thanks
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default link a chart source to a cell reference

Define names. Go to Insert menu Names Define

Enter the following:

Name : myX
Refers To: =B1:B5
Click Add

Name: myY
Refers To: =C1:C5
Click Add

Close the dialog.

Create a chart using the regular range. Click on the series, look at the
series formula in the formula bar. Edit it to change this:

=SERIES(,Sheet1!$B$1:$B$5,Sheet1!$C$1:$C$5,1)

to this

=SERIES(,Sheet1!myX,Sheet1!myY,1)

Click Enter. If you redefine the names defined above, the chart will adjust
accordingly.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Nick" wrote in message
...
Hi, lets say i have a cell A1 that shows the text B1:B5, and i have a cell
A2
that shows the text C1:C5. Then i want to have a chart that references
cells
A1 and A2, and hence knows that i want it to chart the data in arrage B1
to
C5 (an x-y scatter plot). the point being the text values in cells A1 and
A2
might change, and i want to the chart to automatically update and plot the
new ranges specified. i can't work out how to do this. is it possible?

thanks



  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,344
Default link a chart source to a cell reference

Hi Nick,

I read your question to mean you want to run the chart off of INDIRECT(A1)
which would return the contents of the range B1:B5 and use those for the
chart? You can create a name myX which refers to =INDIRECT($A$1). However,
for some reason Excel is not happy with this when you add it to the chart.

So, if I understand your question correctly, I don't know if it is possible.

--
Thanks,
Shane Devenshire


"Nick" wrote:

Hi, lets say i have a cell A1 that shows the text B1:B5, and i have a cell A2
that shows the text C1:C5. Then i want to have a chart that references cells
A1 and A2, and hence knows that i want it to chart the data in arrage B1 to
C5 (an x-y scatter plot). the point being the text values in cells A1 and A2
might change, and i want to the chart to automatically update and plot the
new ranges specified. i can't work out how to do this. is it possible?

thanks

  #4   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,344
Default link a chart source to a cell reference

Hi Nick,

I have found a way, it doesn't use INDIRECT but it let's the chart plot from
a pair of cell addresses in cell A1:A2. It's rather complicated:

1. Define the following names - choose Insert, Name, Define and enter each
of the names below in the Names in workbook box and the formula in the Refers
to box:

Col1 (this formula figures out which column your X data is in but only
works out to column Z as I set it up):

=MATCH(LEFT(Sheet1!$A$1),{"A","B","C","D","E","F", "G","H","I","J","K","L","M","N","O","P","Q","R","S ","T","U","V","W","X","Y","Z"},0)

Col2 (this formula figures out which column contains your Y data - the
OFFSET function needs numbers, not letter):

=MATCH(LEFT(Sheet1!$A$2),{"A","B","C","D","E","F", "G","H","I","J","K","L","M","N","O","P","Q","R","S ","T","U","V","W","X","Y","Z"},0)

H (this formula calculates the height argument for the OFFSET function):

=VALUE(RIGHT(Sheet1!$A$1,LEN(Sheet1!$A$1)-FIND(":",Sheet1!$A$1)-1))

L (this function figures out the starting row of your data)
=VALUE(MID(Sheet1!$A$1,2,FIND(":",Sheet1!$A$1)-2)-1

X
=OFFSET(Sheet1!$A$1,L,Col1-1,H)
Y
=OFFSET(Sheet1!$A$1,L,Col2-1,H)

Now follow Jon instructions for assigning the range names X and Y to the
chart.

1. Select the series on the chart and replace the reference after the !
with X or Y. In 2003 this will automatically change the sheet reference to a
workbook reference, in some earlier versions I believe you needed to type the
entire address over with the workbook name instead of the sheet name.

Now you can select cells A1 and A2 and type in the address as text and the
chart will plot automatically.

You could have defined the names H, L, Col1, and Col2 as spreadsheet cells
where the formulas returned their results.

I tried to substitute all the formula into the X and Y formulas but I either
made a typo or Excel was not happy with them, so I resorted to defining the 4
extra names.

If you need a copy of the workbook let me know.
--
Thanks,
Shane Devenshire


"Nick" wrote:

Hi, lets say i have a cell A1 that shows the text B1:B5, and i have a cell A2
that shows the text C1:C5. Then i want to have a chart that references cells
A1 and A2, and hence knows that i want it to chart the data in arrage B1 to
C5 (an x-y scatter plot). the point being the text values in cells A1 and A2
might change, and i want to the chart to automatically update and plot the
new ranges specified. i can't work out how to do this. is it possible?

thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel changes chart source data. Drops the Filename reference from ybkusz Excel Discussion (Misc queries) 0 February 1st 08 03:14 AM
Auto update chart source reference HankW Charts and Charting in Excel 2 January 15th 07 05:16 AM
How do you link chart source data when you copy the chart? mamagirl Charts and Charting in Excel 1 December 8th 06 02:40 AM
Can Excel 2003 cell link carry with it the source cell format? tom Excel Discussion (Misc queries) 2 July 14th 06 06:14 AM
Using a relative SHEET reference for source data in a chart James Charts and Charting in Excel 6 August 16th 05 05:07 PM


All times are GMT +1. The time now is 01:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"