+ Reply to Thread
Results 1 to 5 of 5

Automatically Referencing Data Ranges In An Excel Scatter Plot

  1. #1
    Registered User
    Join Date
    11-24-2010
    Location
    SE Michigan
    MS-Off Ver
    Excel 2003
    Posts
    5

    Automatically Referencing Data Ranges In An Excel Scatter Plot

    Hi,

    I have a rather large data file. It has 11 columns and 3000 (sometimes more, sometimes less) rows of data. I would like to scatter plot a contiguous subset of this data. This subset is defined by an upper and lower boundary on "x" column of the data. Normally I hand pick the subset and then hand edit the series function in the plot. This can be quite time consuming and I want to automate the process using either a VBA macro or an excel formula or both. I have made some progress by using =address() and =match() to find the beginning and ending rows of the "x's" and "y's" I want to plot.

    For a similar calculation issue "romperstomper" gave me the perfect answer using the following formula

    =linest(index($A$18:$A$5007,startrow):index($A$18:$A$5007,endrow),index($B$18:$B$5007,startrow):inde x($B$18:$B$5007,endrow))
    for example.


    Where "startrow" and "endrow" refer to the two cells where the starting and ending cell address's of data I wish to perform some calculations on (and plot) are stored.

    When I tried to insert the "indexing" part of this into the series formula for the plot I got an error... the errant formula looks like this:

    '=SERIES('50kphR1'!$D$16,'50kphR1'!(index($A$18:$A9998,startrow))index($118:$A$9998,endrow)),'50kphR1'!(index($D$18:$D$9998,startrow)):index(($D$18:D$9998,Dendrow)),1)

    Note: The blue "frowny" face in the formula is the result of a ")" and a ":"

    I am a total newbie to using excel's more advanced functions and really apreciate all the help this forum provides....

    Thanks
    Last edited by groovymoon; 12-07-2010 at 09:10 AM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Automatically Referencing Data Ranges In An Excel Scatter Plot

    Hi,

    If you're using this:

    =SERIES('50kphR1'!$D$16,'50kphR1'!(index(=SERIES('50kphR1'!$D$16,'50kphR1'!(index($A$18:$A9998,startrow)),startrow))............

    startrow or the cell it refers to needs to be a number not an address, this way the series will begin at the nth row in the range $A$18:$A9998.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    11-24-2010
    Location
    SE Michigan
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Automatically Referencing Data Ranges In An Excel Scatter Plot

    Thanks for the answer.. but either I do not understand the answer or I did not communicate my problem properly....

    I have the determined, using =match(), the starting and ending rows of the data I want to plot, I just can't get that information properly into the =series() function for the plot.

    The columns are fixed in the sheet, it's the rows that will change with every different data set.

  4. #4
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Automatically Referencing Data Ranges In An Excel Scatter Plot

    You'll almost certainly find it easier to use named ranges to define your plotted data. Please take a look at the attachment to see if it helps..
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-24-2010
    Location
    SE Michigan
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Automatically Referencing Data Ranges In An Excel Scatter Plot

    Yes.... I used named ranges. Since I already new the "startrow" and "endrow" of the ranges I wished to plots I was able to define the address's of the named ranges using the =offset() function. The problem then became trivial... Thanks for all your help and thanks for the excellent example (much better than other I saw on the net).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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