+ Reply to Thread
Results 1 to 12 of 12

Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

  1. #1
    Registered User
    Join Date
    02-07-2014
    Location
    London, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    6

    Angry Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

    Hey all!

    Okay, here's what's going on:

    I have a line chart that is based on dynamically allocated ranges of data. It plots a measured quantity against a date. In order to allow any subset of the data to be plotted, I've created the line chart using named arrays for both series and category inputs. These named ranges are created in a worksheet using the "offset" function. This allows me to choose any start point and any end point I like, and then to plot them.

    It works really well, except for one major issue: Data labels!

    I need to make notes about specific data points, because they are related to process-based changes on the data I'm tracking. An example would be when we change tooling in the machine, the quantity we're measuring may change. I want to annotate that change of tooling on my chart, and have it stick with that point regardless of how I dynamically scale the data.

    Right now, I have a second set of data that I call "comment" data. It is empty except for when I want to put a note, and when I do, I enter a data value just above the point I wish to annotate. This works well, and shows me that there's something going on. I then display the data labels for the "comment" data, and retype the value as the text I want.

    The problem is, this is manual and kind of lame. We have a need to constantly plot different subsets of the data, and I find that when I do this, the labels I've typed in disappear, and the numbers come back.

    Now, I also have a "Comment field" in the data set that drives the "comment data". I have it set up with an IF command so that only when I enter a comment does the data in the "comment Data" field generate a point (based on the data in another sheet). Thus, the only points for the "comments" data set that get plotted are those associated with comment itself.

    I want to link the values in the data label (or a text box, even) wit the text in the "comment field". I have used the whole "='Sheet_name'!Cell_reference" approach, and it works fine, except that when I dynamically resize the plot area, the text in the data labels disappears!!

    I'm using Excel 2010, and I can't use any third party add ins, because other departments use this file for data entry and plotting too, and they use different computers. So, what I'm wondering is this:

    How can I make it so that the text in the Comment Field is always displayed in the data labels on my graph, regardless of the size of the data subset I'm plotting. If I label a point as "tool change", I'd like it to always say that, whether I plot a week, a month or even a year's worth of data.

    I hope this makes sense. I've included a copy of the sheet here, too, if you want to take a look.

    This is pretty frustrating to me. I think Excel 2013 can do this, but we won't be that advanced for a bit!

    Thanks for any help!
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

    Have a read of this article about linked data labels and changing data series.
    http://www.andypope.info/ngs/ng57.htm
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    02-07-2014
    Location
    London, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

    Hey Andy:

    I've tried to read and understand that post you pointed to numerous times, and I just don't get it. I don't know what the indexing does, since your graph shows a "C" label, but the indexed column doesn't contain "C" anywhere. I guess I'm missing something.

    My problem is that when I scale a graph dynamically (See my attached file), the data labels, even though they're defined as =<whatever sheet>!<Cell_reference>, change when I change the scale. I can see how what you're proposing for the data filtration works for filtering, but will it work for dynamically scaled data?

    If so, can you try and explain it to me, in layman's terms, what it is that your example is doing, and how did you assign the data labels to the text?

    What happens if you, instead of filtering the data, only select a subsection of data? Will that cause chaos for the labels?
    Actually - I downloaded the example and tried it; I plotted from 4-8 in the respective rows. The data labels were wrong; I plotted from C-G, but the labels, both sets, were from A-E. I needed the labels to change too!

    Thanks!
    Last edited by TFA_Faust; 02-10-2014 at 07:59 PM.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

    Try this simplified example.

    Named ranges chart 5 data points with the start point being changed via the slider.
    You can see the data points and category labels update correctly.

    Both sets of data labels are linked to the columns of text to be displayed.
    The first is simply the list and does not update with scrolling data.
    The second is an index list which does update.

    The links between data labels and cells is a static one. The first data label is always linked to the first cell. This part is not dynamic.
    In order for it to be dynamic, without changing the text to display, would be to have a named range for each data label.

    That would mean data label 1 would have to replace existing linkage, =Sheet1!$F$3
    with a dynamic one. Such as =DLText1

    where DLText1 was a named range based on a formula such as =OFFSET(MY_LABELS,0,3,1,1)
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-07-2014
    Location
    London, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

    Hey Andy:

    I'm getting there. I see how you're getting what is going on, and I believe that I get what you're saying about the dynamic allocation of the label text based on a named range.

    The problem is, that means you'll have to enter the text for each data point individually, no?

    Is there a way to dynamically allocate all the data labels at once, say as an array or something? There are only 5 data points in the example, but in my application, there could theoretically be hundreds, and I need them all to label automatically and to do so based on the length of the vectors being plotted.

    Is there a way to do this?

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

    Yes you have to enter the cell reference to each data label individually.
    However you can use code to automate the task. Or there is a free addin. http://www.appspro.com/Utilities/ChartLabeler.htm
    In xl2013 you can not do it via the UI.

    Once the connection has been made it is retained. So if you make your data series 100 data points long and assign the cells you should find reducing the series length and then extending it will retain the original links. The thing is does not do is update the link references. So the first data label always references the first data point link.

  7. #7
    Registered User
    Join Date
    02-07-2014
    Location
    London, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

    Thanks, Andy.

    I have seen a bit of VB code to automate the chart labeling, but I am not good with VB at all (zero training, almost zero experience), so I was hoping that XL2010 would have some way to assign an array of value as data labels. I guess that's not going to be the case, though!

    The big killer for this project isn't just that the data can grow or shrink, but that the first and last points can both change. I need some way to associate a specific point with a specific label, but I guess short of VB that there's no way to do that, is there?

    It's a shame, because with the ability to dynamically scale charts and move the endpoints, it's possible to almost make a perfect chart for what I need. Only this one issue remains.

    There's not some kind of array function for this, is there?

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

    No array function.
    No mass linking unless you use code or addin (somebody elses code) or have xl2013.

    The example I posted shows you how to work around the problem.

  9. #9
    Registered User
    Join Date
    02-07-2014
    Location
    London, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

    Okay, thanks.

    The example only works though, I thought, when the number of data points is static. Technically, I can have anywhere between one and 1000 data points on my graph. If that's the case, then how will the labeling from your example work?

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

    here is the example with upto a 1000 data points.

    you can control both start and length of data series.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    02-07-2014
    Location
    London, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

    Man, that's awesome, but I must be missing something.

    It works, first of all, which is awesome.

    However, I don't get HOW it works. How did you get it so that each point has a specific cell assigned to it as data label text. The fact that it automatically does this for any number of points tells me I've missed something here.

    I was going in and manually editing the text in each data label to be "sheet_Name!point", but it seems that yours is automatically assigning this. Can you explain to me how you do that?

    Thanks, man. Sorry to be dense. I can tell I've almost got it, but this one piece of the puzzle is missing.

    Thanks!

  12. #12
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Linking Data Labels to a Cell on Dynamically Allocated chart! Can't get it!

    I used the free addin I mentioned back in post #6.

    However you can use code to automate the task. Or there is a free addin. http://www.appspro.com/Utilities/ChartLabeler.htm
    If you set it up with all 1000's data points linked then it will remember those links when the data point is used.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dynamically Linking Tranposes Data
    By dave_gordon in forum Excel General
    Replies: 15
    Last Post: 05-03-2012, 11:13 PM
  2. 'Reverse Linking' Cell Data to Chart
    By Lock in forum Excel General
    Replies: 1
    Last Post: 08-13-2011, 05:18 AM
  3. Linking dynamically allocated row offset to stacked column chart data range variable
    By amanagarwal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-05-2011, 02:25 PM
  4. add data labels in charts with tools (dynamically)
    By uriel78 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-14-2005, 09:06 PM
  5. Custom format dynamically linked data labels
    By ucamms in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-29-2005, 02:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1