+ Reply to Thread
Results 1 to 11 of 11

Thread: Require Scatter Chart that doesn't Plot Zero or "-"

  1. #1
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    137

    Question Require Scatter Chart that doesn't Plot Zero or "-"

    Hi All,

    I have a scatter chart that is used to display some x, y data in my spreadsheet. This x,y data is calculated through if statements from other data. If the a value is outside my limits of the If statement a "-" is created in the x or y cell.

    I am trying to find a way that with the two columns for x and y highlighted, the plot will only show data that does not include a "-". At current if the fields are x= "-" and y = "-" it plots the y value as zero with increasing x.

    I have included an example to explain my point. I only want the graph to display the non zero and non "-" values from the x, y data.

    Any help on the above would be appreciated!
    Attached Files Attached Files

  2. #2
    Forum Guru 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Vienna, VA, USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    2,257

    Re: Require Scatter Chart that doesn't Plot Zero or "-"

    This is a "poor man's" solution but I have used it and it certainly works. Instead of generating "-", generate a -1. Then on your chart, modify the scale for each axis to have a minimum of 0. Then the negative points do not appear on the plot.

    Alternatively, if you have no actual data that has a 0 (there is none in your example), you can take your existing data and just modify the scales to start at something higher than 0.
    Making the world a better place one fret at a time
    ||||||

    If someone helped you, please click on the star icon at the bottom of their post

    If your problem is solved, please update the first post:
    EDIT, Go Advanced button, set Prefix to SOLVED

    [code]
    ' Enclose code in tags like this
    [/code]

    Don't attach a screenshot
    --just attach your Excel file! It's easier and will let us experiment with your data, formulas, and code.

  3. #3
    Forum Guru 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Vienna, VA, USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    2,257

    Re: Require Scatter Chart that doesn't Plot Zero or "-"

    On second look at your workbook, I see that the nonnumeric cells seem to screw up how the scatter chart is plotted. That is, it doesn't use your actual x values to plot, it uses the sequence number. I am guessing that is how Excel responds to finding text data when doing a chart. In that case I would emphasize that my advice above will solve it.
    Making the world a better place one fret at a time
    ||||||

    If someone helped you, please click on the star icon at the bottom of their post

    If your problem is solved, please update the first post:
    EDIT, Go Advanced button, set Prefix to SOLVED

    [code]
    ' Enclose code in tags like this
    [/code]

    Don't attach a screenshot
    --just attach your Excel file! It's easier and will let us experiment with your data, formulas, and code.

  4. #4
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    137

    Thumbs up Re: Require Scatter Chart that doesn't Plot Zero or "-"

    Thanks '6StringJazzer' - I'll take your advice and have a go at that now!
    Thanks for your help!
    Mark

  5. #5
    Forum Guru
    Join Date
    10-28-2008
    Location
    Not here anymore
    MS-Off Ver
    irrelevant
    Posts
    10,151

    Re: Require Scatter Chart that doesn't Plot Zero or "-"

    RS6,

    you can use dynamic range names to define the populated cells of your sheet as the range to be graphed.

    Range name

    ChartX =INDEX(INDEX(Sheet1!A:A,MATCH(MIN(Sheet1!A:A),Sheet1!A:A,1)):INDEX(Sheet1!$A:$A,MATCH(99^99,Sheet1!$ A:$A,1)),0)

    ChartY =OFFSET(ChartX,0,1)

    Then define the data series as

    Series X values =Example_File.xls!ChartX
    Series Y values =Example_File.xls!ChartY

    This will grow and shrink as you add values to your columns A and B. Empty cells in the first few rows of A and B will be ignored in the chart.

    see attached

    hth
    Attached Files Attached Files
    Last edited by teylyn; 03-11-2010 at 05:23 AM. Reason: dypo

  6. #6
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,785

    Re: Require Scatter Chart that doesn't Plot Zero or "-"

    or perhaps
    edit i forgot you said 0 or - so perhaps use =IF(OR(A2={"-",0}),NA(),A2)
    or just do as andy suggests below
    Attached Files Attached Files
    Last edited by martindwilson; 03-11-2010 at 06:42 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    11,351

    Re: Require Scatter Chart that doesn't Plot Zero or "-"

    Or you can use =NA() instead of -
    Cheers
    Andy
    www.andypope.info

  8. #8
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    137

    Question Re: Require Scatter Chart that doesn't Plot Zero or "-"

    Thank you all for your input!
    The '=NA()' did the trick and the graph now only plots the required numbers. However my =SLOPE() function now no longer works as it sees '#N/A' in the data set. Is there any way to get around this. I.e. such that the slope function only looks for the cells containing actual values. ( LINEST() function also affected by the '#N/A's)

    I have a feeling that the methodology posted by 'teylyn' may solve this however looking at the re-uploaded example I cannot see how the 'dynamic range names' work. They are not something I have used before.

    Ideally if there is a way to modify the SLOPE() function formula this would be ideal.

    Cheers Guys - Really appreciate it!
    Mark

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    11,351

    Re: Require Scatter Chart that doesn't Plot Zero or "-"

    simply use a different set of data for the chart than for the SLOPE/LINEST functions.
    Cheers
    Andy
    www.andypope.info

  10. #10
    Forum Contributor
    Join Date
    07-28-2008
    Location
    Leamington Spa, UK
    MS-Off Ver
    2010
    Posts
    137

    Re: Require Scatter Chart that doesn't Plot Zero or "-"

    Okay - cheers Andy - I'll do that and hide the columns!

    Mark

  11. #11
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    11,351

    Re: Require Scatter Chart that doesn't Plot Zero or "-"

    Make sure the chart has the option to display visible cells only turned off.

    Select the chart and then use Tools > Options > Chart > Plot visible cells only.
    Cheers
    Andy
    www.andypope.info

+ 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.2.0