Create an X Y Scatter Chart with Data Labels

Поділитися
Вставка
  • Опубліковано 19 січ 2025

КОМЕНТАРІ • 308

  • @eivihnd
    @eivihnd 10 років тому +210

    Actually, there is a function to add descriptive labels in Excel 2013:
    After you have created your XY Scatter Graph, selected X- and Y-values and clicked "Add Data Labels" (4:15 in this video), do the following:
    1. Click on one point so that they are all highlighted
    2. Right click on one of them (while all are highlighted), and click "Format Data Labels"
    3. Under "Label Options" appearing on the right side (default), deselect "X Value" and "Y Value"
    4. Select "Value From Cells"
    5. Click on the button "Select Range"
    6. Now, select the row containing data for your labels (for example the "items" column)
    7. Voilà, you have custom labels with no coding needed.

    • @bigheadmonkeyboy
      @bigheadmonkeyboy 9 років тому

      ***** +eivihnd Thanks to both of you. Helped a lot!

    • @davidfsnyder
      @davidfsnyder 9 років тому

      +Doug H I have Excel for Mac 2011 so I still had to use the macro. Thanks for saving me time!

    • @thomasmurphy6501
      @thomasmurphy6501 9 років тому

      +eivihnd THANK YOU!

    • @fortoday04
      @fortoday04 9 років тому +1

      +eivihnd real MVP

    • @excelnbafun7782
      @excelnbafun7782 9 років тому

      +eivihnd oh wow so nice! Thank you sir.

  • @gregorypiasecki1589
    @gregorypiasecki1589 9 років тому

    YOU ROCK. I have been using excel since 1996 and have been frustrated by my inability to add labels. Thank you!

  • @tha_rock7281
    @tha_rock7281 8 років тому

    You just saved my entire day. Been spending all day trying to add data labels, but with your video it only took 5 min's. Thank you very much!!

    • @DougHExcel
      @DougHExcel  8 років тому

      You're welcome...glad it helped!

  • @alexo9183
    @alexo9183 10 років тому

    I searched for an hour and this is the best explanation I found. Good work! (although you could skip the first 2:20 of the video). Thank you

  • @WorkDovePeace
    @WorkDovePeace 7 років тому

    This was the BEST tutorial I found to figure out how to add data labels to a scatter plot chart. Doug -- Thank you so much for posting this!

    • @DougHExcel
      @DougHExcel  7 років тому

      Wow.... thanks for the kind words!

  • @alannahvirtanen8431
    @alannahvirtanen8431 8 років тому

    Thank you so much!! I've been trying to figure out how to do this and no-one in my office knew the answer. But you did - and made my life so much easier! Thanks very much!

    • @DougHExcel
      @DougHExcel  8 років тому

      You're welcome...thanks for the comment!

  • @ivankitta9458
    @ivankitta9458 3 роки тому

    Thank you so much, Doug!
    I didn't know it was not possible to label data points in a scatter chart in Excel. I was desperate...

  • @sandman_theory
    @sandman_theory 9 років тому

    Fixed the problem I had by 'adding data manually' just like how you said.. Thanks man!

  • @Rajeshshiva247
    @Rajeshshiva247 8 років тому +3

    I did same in my project with help of this video and I got award.
    thank you sir

    • @1Peezy1
      @1Peezy1 8 років тому

      Good job man!!

    • @Rajeshshiva247
      @Rajeshshiva247 6 років тому

      Sir, please share you mail id because I have prepared one Excel VBA programming for automatically send mail from Excel when due date reached.but email continues trigger after reach due date. I need to stop the mail in the VBA programming. Please support

    • @DougHExcel
      @DougHExcel  4 роки тому

      Thanks Rajesh Dakshanamoorthy, glad it helped!

  • @david.brossard
    @david.brossard 8 років тому +1

    Your video was awesome! The right pace, the right explanation (except maybe for how to create the macro itself), and the end result! Thanks so much

  • @r_b5951
    @r_b5951 9 років тому

    Thank you Doug. Appreciate your time and effort to create this tutorial. I'm running Excel 2010, so the 7-step process posted by eivihnd is not available to me. But since I am running Excel 2010 this tutorial is a great help.

  • @deanm1228
    @deanm1228 10 років тому

    Thanks for the great tutorial. Clear and concise instructions. Saved me hours of work.

  • @debster0626
    @debster0626 7 років тому

    I'm SOOO excited! Thank you SO MUCH for both the pointers!

    • @DougHExcel
      @DougHExcel  7 років тому

      Hi Deb Phillips, glad you liked it, thanks for commenting!

  • @TonyK55
    @TonyK55 8 років тому

    Hi Doug
    Many thanks for this video. I managed to add labels for the first time with them all aligned properly. I did find a couple of issues with filtering data and the code was then mis-aligned. But as I said managed it for the first time with my usual Excel jiggery pokery, thanks again.

    • @DougHExcel
      @DougHExcel  8 років тому

      You're welcome, glad it worked for you!

  • @mattnicks
    @mattnicks 6 років тому

    Really helpful, thank you. Worked first time in Excel 2010.

    • @DougHExcel
      @DougHExcel  6 років тому

      Thanks mattnicks, glad it helped!

  • @JohnMmbaga_
    @JohnMmbaga_ 8 років тому +1

    Thanks a lot Doug. I have successfully attached labels on my excel graphs thanks to your guidance. Much appreciation!!!

    • @DougHExcel
      @DougHExcel  8 років тому

      Glad this helped. Thanks for the comment!

  • @michaelnewman8708
    @michaelnewman8708 7 років тому

    Wonderful! This helped me create a great scatter plot of the revenue and gross margin for our company's product lines. Thank you!

    • @DougHExcel
      @DougHExcel  7 років тому

      Thanks Michael Newman, glad it helped!

  • @stevevh4
    @stevevh4 7 років тому

    Thanks so much for the video! This is exactly what I have been trying to do for days! Now, if I could only control the labels...meaning show and hiding based on what I am sorting...

    • @DougHExcel
      @DougHExcel  7 років тому

      Try using the NA() function for the second table that sources the chart. See this video for some insight. ua-cam.com/video/2pF7sKR8wRQ/v-deo.html

  • @dannykay4967
    @dannykay4967 7 років тому

    first answer that makes sense - you are my hero! and the macro works! thank you so much!

    • @DougHExcel
      @DougHExcel  7 років тому

      You're welcome; thanks for the comment!

  • @The7thFold
    @The7thFold 3 роки тому

    Thanks this really helped. But my labels have very long names. So if I just want each label to have a separate symbol/colour in the graph and then have the labels to appear as legends at the side, how do I do that? I have 14 such labels.

    • @DougHExcel
      @DougHExcel  3 роки тому

      maybe something like this ua-cam.com/video/sNQxUTs6lJA/v-deo.html can give an idea. It'll need to be combined with a change in the series name to reflect the label name.

  • @pandorahope9166
    @pandorahope9166 9 років тому

    Awesome. Thank you! Your explanation was v. clear and worked first time.

  • @Soulenergy31
    @Soulenergy31 4 роки тому

    thank you, but i need the non macro trick, any advice?

    • @DougHExcel
      @DougHExcel  4 роки тому

      If you have excel versions prior 2013, the macro is it. With later version no macro needed. See ua-cam.com/video/NnoFXSFBtIg/v-deo.html

  • @tiffanymitchell2703
    @tiffanymitchell2703 9 років тому

    This was very helpful, thank you. When running the macro, you have to have the chart selected, or else it won't work.

  • @gangaramchoudhary3711
    @gangaramchoudhary3711 7 років тому

    Thank you very much my friend Mr. Doug H. I appreciate your video.

    • @DougHExcel
      @DougHExcel  7 років тому

      Hi Gangaram Choudhary...you're welcome, glad you liked!

  • @richardvaughan9798
    @richardvaughan9798 8 років тому

    you're a hero, Doug! Fantastic. Thanks so much.

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi Richard Vaughan, you're welcome!

  • @jeff32407ify
    @jeff32407ify 9 років тому

    Thank You!!!! Manually added the data and it worked.

  • @rodrigolovaton797
    @rodrigolovaton797 8 років тому

    When you add the macro in VBA, you have to do it as "insert / module", otherwise it doesn't work. At least that fixed the problem for me. Thanks for the video!

  • @turtleandtree
    @turtleandtree 8 років тому +18

    You did not walk through the macro section...

    • @neomaster117
      @neomaster117 8 років тому +5

      Developer -> Visual Basic -> Insert -> Module -> Paste code and Save. Also, you will get an error unless both X and Y values are filled in.

    • @freewonderland
      @freewonderland 8 років тому +1

      thank you!! this was really helpful.

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi Matthew Morton, thanks for the comment!

  • @oskarstenholm4687
    @oskarstenholm4687 4 роки тому

    Is it possible to seperate the labels even more? As Items 15, 17 and 19 are pretty close together?

    • @DougHExcel
      @DougHExcel  4 роки тому

      Yes click on the label. The 1st click select all, a 2nd click should just be that label. Then you can move the text box around

  • @xcharles1
    @xcharles1 9 років тому +2

    Thanks, Doug!
    My scatter has hundreds of points with dense concentrations in areas; the labels appear per your instructional, but are cluttered and cannot be read/presented. Any idea on how to do this, so that when you hover your mouse, the label appears ala a standard chart with auto labels?

  • @jeremylowrey1878
    @jeremylowrey1878 8 років тому

    Hi Doug H,
    I think it would be best if you posted the solution from eivihnd into the summary. This would have saved me a lot of time If I knew ahead of time when reading the summary, "IF YOU HAVE EXCEL 2013 just read the steps below"
    Actually, there is a function to add descriptive labels in Excel 2013:
    After you have created your XY Scatter Graph, selected X- and Y-values and clicked "Add Data Labels" (4:15 in this video), do the following:
    1. Click on one point so that they are all highlighted
    2. Right click on one of them (while all are highlighted), and click "Format Data Labels"
    3. Under "Label Options" appearing on the right side (default), deselect "X Value" and "Y Value"
    4. Select "Value From Cells"
    5. Click on the button "Select Range"
    6. Now, select the row containing data for your labels (for example the "items" column)
    7. Voilà, you have custom labels with no coding needed.
    Thanks,
    -Jeremy

    • @jeremylowrey1878
      @jeremylowrey1878 8 років тому

      And then sum? Do you know how to automatically adjust the min and max for the x and y axis based off the min and max of the data selected? This way u only see the grid where my points are and not from 0?

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi Jeremy Lowrey, thanks for the comment!

  • @elizabethnoordhoek4029
    @elizabethnoordhoek4029 10 років тому

    Thank you so much I was so confused on how to create different series for scatter plots!

  • @excelisfun
    @excelisfun 10 років тому +1

    Thanks, Doug!!

  • @esa2236
    @esa2236 7 років тому

    You can right click a point on the scatter plot and click on "add data labels" then manually change the label of each point on the graph.

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi Skid, thanks for the comment!

  • @123canuckfan
    @123canuckfan 9 років тому

    Great Video Doug. How can I retain the labels when I filter?

    • @123canuckfan
      @123canuckfan 9 років тому

      ***** Thanks Doug. What I was attempting to do was filter one or two items and only show those on the scatter plot. However, when I filter, it still displays the first value, with the information from the item that I selected. For example, if I filter to only display Item 2, it will plot (60,48) but still show Item 1 as the label. Hope this makes sense. I would really appreciate the help. Thanks in advance. :)

  • @sweehubers2649
    @sweehubers2649 7 років тому

    Hi Doug - great presentation and thank you very much - this was very helpful. Recently we needed to edit/change the label value. So we changed the label name in the Excel column, but the graph did not automatically update to reflect the new value. How do we do this so it's automatic and we don't have to do the whole thing over?

    • @DougHExcel
      @DougHExcel  7 років тому

      if you've got Excel 2013, you can actually put labels without any VBA. See video at ua-cam.com/video/NnoFXSFBtIg/v-deo.html
      If you don't you'll have to do it over again :-(

  • @Chakoando
    @Chakoando 9 років тому

    Thanks so much to both Doug and eivihnd!

  • @joseph10171
    @joseph10171 5 років тому

    What a life saver. Thank you

    • @DougHExcel
      @DougHExcel  5 років тому

      Hi Joseph George, thanks for the kind words!

  • @melc8895
    @melc8895 9 років тому

    This worked great except for one thing. When I ran the macro, it also plotted a point (0,0) for the Item column heading. How do I fix that?

  • @garykassabian151
    @garykassabian151 8 років тому

    Excellent job ! Thank you so much for making this video.

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi Gary Kassabian, you're welcome!

  • @TheSpiralout11235
    @TheSpiralout11235 10 років тому

    Thank you very much Doug. Great tutorial. Do you happen to know how I can loop through each series in my chart?

  • @nlmxyz
    @nlmxyz 6 років тому

    thanks so much. Extremely useful. Had been trying for several hrs

    • @DougHExcel
      @DougHExcel  6 років тому

      Hi Indra Bishop, glad you liked it, thanks for commenting!

  • @richardrawlings3733
    @richardrawlings3733 10 років тому

    Hi Doug - please could you post the code here, as the link no longer works. Thanks!

  • @Robis1K
    @Robis1K 8 років тому

    Thank you very much. Very helpful!
    May be relevant to highlight that your excel file should allow macros. Sometimes it is not the case by default. Hence when saving the macro you receive a warning and you should click on "no" and choose a macro-enabled excel format. I wasted a hour because of that

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi Roberto M, thanks for the comment!

  • @jameshaythornthwaite5195
    @jameshaythornthwaite5195 9 років тому

    Thanks Doug. This works fine for me, but I'm having issues when I include more than one data series. In this instance, only the first data series is labelled when I run the macro.
    Do you have any advice?

    • @jameshaythornthwaite5195
      @jameshaythornthwaite5195 9 років тому

      James Haythornthwaite I managed to fix this - you need to change the series number in the brackets after any reference to "SeriesCollection" in the macro to then apply the macro to that specific series.
      Cheers

    • @natalynievesreyes5281
      @natalynievesreyes5281 9 років тому

      James Haythornthwaite how about if I have 40 different series? How did it work for you with more than one data series? Thank you!

  • @prabodh231
    @prabodh231 9 років тому +1

    That's an excellent tutorial! Many thanks

  • @robhargroves7600
    @robhargroves7600 4 роки тому

    H Doug - I have tried this macro, however it provides for an error.
    "xVals = Mid(xVals, InStr(InStr(xVals, ","), xVals, Mid(Left(xVals, InStr(xVals, ",") - 1), 9)))"
    I guess it pretty much has to do with the range that is being sellected. Please advise?

    • @DougHExcel
      @DougHExcel  4 роки тому

      If you have Excel 2013 or later, there is a function to add descriptive labels you can actually put labels without any VBA. See video at ua-cam.com/video/NnoFXSFBtIg/v-deo.html

  • @alejandrocastillo54
    @alejandrocastillo54 9 років тому

    You've saved me hours of work

  • @ziyabg1461
    @ziyabg1461 6 років тому

    Thank you Doug! that is helpful. This option should be available through "Format data labels" by clocking on any data point.

    • @DougHExcel
      @DougHExcel  6 років тому

      Hi Elton Mammadov, glad you liked it, thanks for commenting!

  • @thuyhainsworth4739
    @thuyhainsworth4739 8 років тому

    Thanks so much! I couldn't do this over my class, but now "IT WORKS". Btw, Do I need to select the data that I want to create a Scatter-plot?

    • @DougHExcel
      @DougHExcel  8 років тому

      Glad it worked for you. Yes, you'll need to select the data to fill out the chart, that can be done before or after you Insert>Chart

  • @kindredsoul1973
    @kindredsoul1973 9 років тому

    Excel 2013 - I am trying to show results of two measurements (y is measurement one, x is measurement 2), each unit of measure is minutes spent playing video games. The x data is what my observer recorded (number of minutes each child spent playing video games, 20 children total). Y data is what observer 2 recorded (in minutes for each child spent playing video games). So - my coders viewed video tapes of areas in which children spent time playing video games. [interrater reliability] - and I want to show this in a scatterplot in which the first set of data (y) and the second set of data (x) are on the same scatter chart - but I get to the part in your video in which you manually add the chart (7:22) and my spreadsheet does not appear the same - my chart styles look completely different. Do I need to customize or add something to my access tools? Thanks - sorry if this totally confuses you - I'm totally stuck on this!

  • @FreshlyBased
    @FreshlyBased 10 років тому

    Thanks, this just saved my project!

    • @arashrezaee3318
      @arashrezaee3318 10 років тому

      ***** hi Doug. could you please share the Macro that you used for data label. i can not find that!

    • @arashrezaee3318
      @arashrezaee3318 10 років тому

      ***** highly appreciated!

    • @arashrezaee3318
      @arashrezaee3318 10 років тому

      ***** hi Doug! i found sth else in this case. it is called "XY chart Label". i downloaded it for free also: [ www.appspro.com/Utilities/ChartLabeler.htm] it is very useful for those people who wanna labeling a lot of different data.

  • @juleswombat5309
    @juleswombat5309 5 років тому

    All I got was a runtime error 91 : xVals Object variable or With Block not set ?

    • @DougHExcel
      @DougHExcel  5 років тому

      Sorry, don’t understand the comment/ question...

  • @wuqingli9255
    @wuqingli9255 7 років тому

    Thanks, it is really helpful! How to implement in power point?

    • @DougHExcel
      @DougHExcel  7 років тому

      Thanks Wuqing Li! You can embed this as an object in PowerPoint or copy paste as an image.

  • @felipe28g
    @felipe28g 8 років тому +7

    It's kind of crazy that Excel doesn't do this for you. One would think it's just common sense to have that

    • @felipe28g
      @felipe28g 8 років тому

      Oh great to know, thanks Doug!

    • @timbuxton8977
      @timbuxton8977 7 років тому

      It does! - see eivihnd above. Also works in Excel 2016. For some reason excel keeps quiet about it.

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi Juan Ramirez, thanks for the comment!

  • @TitoKnowsWell
    @TitoKnowsWell 9 років тому

    Hey Doug, I currently have an excel sheet with 3 series!
    All the data of the 3 series are in a sheet (DataSheet), and the chart is in separate worksheet loading the data from the datasheet.
    First of all would I need 3 different sheets for each series so i can apply the labels and does the chart need to be on the same sheet when loading the data? Also when I apply the macro, do I apply to the entire excel file, or on the sheets or on the tabs for this scenario!
    Thanks in advance!

    • @TitoKnowsWell
      @TitoKnowsWell 9 років тому

      +Doug H Well the client hasnt upgraded to 2013 which doesnt allow me to work on it!
      Why I say I have to put each series in a seperate sheet, because the code assumes that the first column contains the label and the other 2 columns contain values to load from!

    • @TitoKnowsWell
      @TitoKnowsWell 9 років тому

      What if I told you, I just I found a way that is not shown on the Internet and is far easier than yours but requires slight manual labor and no Macro!!!

  • @oasis4margaret
    @oasis4margaret 7 років тому

    Thank you so much for sharing, Doug. But is it only me that I googled more than 3 pieces of code and none of them work or it's the same with other ppl?

    • @DougHExcel
      @DougHExcel  7 років тому

      The description field in this video has a link to the msft site so hope that helps.

  • @jessicahalfmann7218
    @jessicahalfmann7218 9 років тому

    How would a draw a line down the middle the perfectly split the chart? Thank you Doug H!

  • @mehdi5738
    @mehdi5738 9 років тому

    Really nice. thanks dude. I learnt a lot of stuff with this vid

  • @volkerfremuth7746
    @volkerfremuth7746 8 років тому

    Thanks, was driving me nuts!

  • @lepermessiah01
    @lepermessiah01 9 років тому

    Do you know if the code works with negative values? I tried doing it, but it does not seem to work

  • @maxpayne7
    @maxpayne7 8 років тому

    Hey Doug, I have list of 20 items and need the data points to have different colors. Is there a sustainable way in the macro that I can do this, instead of manually changing the colors for each data point. Thanks.

    • @DougHExcel
      @DougHExcel  8 років тому

      There probably is a macro out there that can do it but I don't know VBA too well. An option is to select the first record to build the graph. Then select the 2nd record and paste it in there. The series would have a different color for the markers and subsequent series would have varying colors too.

    • @lisachen9546
      @lisachen9546 7 років тому

      hitesh setpal use series in excel if you are able to group your data points in some sort of fashion

  • @logen99999
    @logen99999 7 років тому

    This was super helpful. thank you!

    • @DougHExcel
      @DougHExcel  7 років тому

      You're Welcome! Glad you found it helpful!

  • @cheerli6602
    @cheerli6602 7 років тому

    do you know why i would run into the error "object variable or with block variable not set"?

    • @DougHExcel
      @DougHExcel  7 років тому

      You might want to try from the beginning to see if it works. Also this is on Excel 2010 Windows; so if you have a different setup it might have something to do with it. Unfortunately i'm a vba guy but here's something from stack overflow stackoverflow.com/questions/22735093/vba-for-excel-throws-object-variable-or-with-block-variable-not-set-when-there

  • @asyrafsalman5808
    @asyrafsalman5808 9 років тому +1

    Hi, thanks for the video! How does one edit the macro so that it displays name, x-axis figure, and y-axis figure as well?

  • @profjn4418
    @profjn4418 7 років тому

    Thanks to Doug H and Thomas Paine!

  • @helenahall-manning335
    @helenahall-manning335 7 років тому

    Thanks so much for this! It worked perfectly!

    • @DougHExcel
      @DougHExcel  7 років тому

      Hi Helena Hall-Manning...you're welcome, glad you liked!

  • @jenwither
    @jenwither 8 років тому

    This macro isn't working on my mac! It's still labelling the plotted points with numbers rather than the country label! Any ideas?

    • @DougHExcel
      @DougHExcel  8 років тому

      Not sure on how this would work on Mac as this was for windows :-(

    • @jenwither
      @jenwither 8 років тому

      sorted it out, thanks, super helpful video

    • @christiandevey3898
      @christiandevey3898 8 років тому

      how did you fix it?

  • @maxwellzt
    @maxwellzt 9 років тому

    Dear Doug: your video helped me a lot. Thanks. My scatter plot has different legends(e.g. It has 2 series), then the code cannot add labels, and give "Object variable or with block variable not set" error. Could you please help me on this? Thanks

  • @piyushsood3576
    @piyushsood3576 9 років тому +5

    Hi Doug,
    Great video and it helped me a lot. The problem I am facing is that there are a lot of data points on the scatter plot which make data labels overlap and it gets difficult to identify. Is there a way to remove the data labels and only show them when we hover over the data point?
    Thanks!

    • @timbuxton8977
      @timbuxton8977 7 років тому

      Just click and drag any overlapping data points to move them apart. excel puts in a little data pointer for you.

  • @thetribal
    @thetribal 8 років тому

    excellent demonstration. Thank you.

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi Ali Khan, thanks for the comment!

  • @abcdefg92589
    @abcdefg92589 8 років тому

    Hi Dough and thank you so much for your video.
    Unfortunately, the last part of the macro doesn't work and I have the following error:
    "Object variable or With block variable not set"
    Consider that I use the values that depend from a vlook formula and they come from a data download.
    Thank you so much and thank for your help.

    • @DougHExcel
      @DougHExcel  8 років тому

      You may try to copy paste values onto another sheet and do the charting to see if the vlookups are causing your error.

  • @riaanvanaarde
    @riaanvanaarde 9 років тому

    Hi,
    Works great. I get the following error though. Using Excel 2010
    Object variable or Block Variable not set
    Can you assist please.

  • @marinabouzon2524
    @marinabouzon2524 10 років тому +3

    Thanks a lot Doug H! It saved my dissertation thesis graphs! FYI, the macro code I took from the link you give here didn't work. I used this one instead:
    Sub AttachLabelsToPoints()
    'Dimension variables.
    Dim Counter As Integer, ChartName As String, xVals As String
    ' Disable screen updating while the subroutine is run.
    Application.ScreenUpdating = False
    'Store the formula for the first series in "xVals".
    xVals = ActiveChart.SeriesCollection(1).Formula
    'Extract the range for the data from xVals.
    xVals = Mid(xVals, InStr(InStr(xVals, ","), xVals, _
    Mid(Left(xVals, InStr(xVals, "!") - 1), 9)))
    xVals = Left(xVals, InStr(InStr(xVals, "!"), xVals, ",") - 1)
    Do While Left(xVals, 1) = ","
    xVals = Mid(xVals, 2)
    Loop
    'Attach a label to each data point in the chart.
    For Counter = 1 To Range(xVals).Cells.Count
    ActiveChart.SeriesCollection(1).Points(Counter).HasDataLabel = _
    True
    ActiveChart.SeriesCollection(1).Points(Counter).DataLabel.Text = _
    Range(xVals).Cells(Counter, 1).Offset(0, -1).Value
    Next Counter
    End Sub

    • @itrefresh
      @itrefresh 9 років тому

      Hi, thank you it worked for me this code aswell. Thank you too Doug H

    • @carlosgull1654
      @carlosgull1654 6 років тому

      It's work Very Well, thanks for you code!!!

  • @PernilleDahl
    @PernilleDahl 8 років тому

    Thank you! that was really good explaining! :D

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi PernilleDahl, you're welcome!

  • @GreyFoxNinjaFan
    @GreyFoxNinjaFan 8 років тому

    Great video. Really helped me out.

  • @waynebarthule
    @waynebarthule 7 років тому

    Awesome, thanks Doug!

    • @DougHExcel
      @DougHExcel  7 років тому

      +Wayne Barthule Glad you liked!

  • @arunswaminathan7375
    @arunswaminathan7375 6 років тому

    I have a scatter plot with 3 sets of data (series 1, series 2, series 3) but with the same set of data labels (the 'Items' column in your example). Is there a macro code for this kind of a problem?

    • @DougHExcel
      @DougHExcel  6 років тому

      if you have Excel 2013 or later, you don't need the macro anymore. See ua-cam.com/video/NnoFXSFBtIg/v-deo.html

  • @yvkoay
    @yvkoay 8 років тому

    Thanks a lot. This is really good!

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi Dadawa, thanks for the comment!

  • @marchansen528
    @marchansen528 8 років тому

    Super helpful, thank you!

  • @lorenzolou2570
    @lorenzolou2570 4 роки тому

    I also run it but got some errors here
    'Store the formula for the first series in "xVals".
    xVals = ActiveChart.SeriesCollection(1).Formula

    • @DougHExcel
      @DougHExcel  4 роки тому

      If you have Excel 2013 or later, there is a function to add descriptive labels you can actually put labels without any VBA. See video at ua-cam.com/video/NnoFXSFBtIg/v-deo.html

  • @astutidewiwarawati7670
    @astutidewiwarawati7670 9 років тому

    This vid helps a lot...
    Thank's so much :)

  • @maggiebadaraco7053
    @maggiebadaraco7053 7 років тому

    Soo you can have the series name display the data label value, but I had to add each point individually. In 2013, I have to add each data point individually in the select data box. Once the point is in, I add the data label, in the data label I select the series name, and x value option and in my case, I enter a new line. I use the scatter chart to make milestone across a range of dates. In 2016 it did it just fine. It pulls the series name as the data label, the x values is a date in my data and the y value is the vertical position. My extra layer is it all has to show in office 365 so our employees can access the graph on their phones.

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi Maggie Badaraco, thanks for the comment!

  • @davidgiles3884
    @davidgiles3884 8 років тому

    Does this work on a macbook as well?

    • @DougHExcel
      @DougHExcel  8 років тому

      I'm not sure for other versions, but if you are running office 2016 for mac, it's probably going to work

    • @tremolo_painter
      @tremolo_painter 8 років тому

      Hi David, yes, I tried it today, and it works just fine. Thanks Doug!!

  • @axetrac10
    @axetrac10 8 років тому

    Loved the video...very informative.

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi Akshay Kamath, thanks for the comment!

  • @agniandjani
    @agniandjani 8 років тому

    thank you so much! this is really helpful :)

    • @DougHExcel
      @DougHExcel  4 роки тому

      Thanks tinypeaces, glad it helped!

  • @PhelipeRabay
    @PhelipeRabay 8 років тому

    Thanks a lot. Nice tutorial :)

  • @yem.t.3930
    @yem.t.3930 5 років тому

    Thank you very much Sir!

  • @likepiano
    @likepiano 6 років тому

    thanks, very helpful video!

    • @DougHExcel
      @DougHExcel  6 років тому

      Thanks like piano, glad it helped!

  • @JacobColegrove
    @JacobColegrove 6 років тому

    Thank you that worked wonders.

    • @DougHExcel
      @DougHExcel  6 років тому

      Hi Jacob Colegrove, glad you liked it, thanks for commenting!

  • @Amrtemraz
    @Amrtemraz 9 років тому

    Hi Doug,
    The macro returns an error whenever i run it.
    i am running Excel 2013.
    Error Code: Run-time Error '91'
    Object variable or with block variable not set
    when i try to debug it; it points out to the below line:
    xVals = ActiveChart.SeriesCollection(1).Formula
    Please advise.
    thanks anyways.

    • @Amrtemraz
      @Amrtemraz 9 років тому

      turns out it is coz i am running 2013.
      and there is a very quick fix to it there :)
      exde601e.blogspot.ae/2014/11/adding-labels-to-excel-scatter-charts.html

  • @lagbaja3735
    @lagbaja3735 10 років тому

    Fantastic. Thanks very much

  • @lingfocus2133
    @lingfocus2133 8 років тому

    How can we do it office 2016 for mac?

    • @lingfocus2133
      @lingfocus2133 8 років тому

      I sorted that out. Thanks a lot for sharing. It was very helpful.

    • @DougHExcel
      @DougHExcel  4 роки тому

      Hi LingFocus, thanks for the comment!

  • @sr7882
    @sr7882 9 років тому

    that was excellent thanks dude

  • @15Dalma15
    @15Dalma15 7 років тому

    Thanks! It helped a lot! :)

    • @DougHExcel
      @DougHExcel  7 років тому

      Hi Dalma dr. Geréné dr. Radványi...you're welcome, glad you liked!

  • @sandraschultz3104
    @sandraschultz3104 9 років тому

    why was first graph not correct and then you did custom?

  • @Ratnabhsl
    @Ratnabhsl 8 років тому

    thank you very much! very helpful :D

    • @DougHExcel
      @DougHExcel  4 роки тому

      Thanks Ratnabhsl, glad it helped!

  • @tengkutheo908
    @tengkutheo908 10 років тому

    very helpful, thanks

  • @nicbowles
    @nicbowles 8 років тому

    Thanks, very helpful

  • @alexrosen8762
    @alexrosen8762 7 років тому

    Very useful. Thanks!

    • @DougHExcel
      @DougHExcel  7 років тому

      Hi Alex , thanks for the comment!