+ Reply to Thread
Results 1 to 6 of 6

Have line graph not plot entries that repeat

  1. #1
    Registered User
    Join Date
    07-19-2005
    Posts
    26

    Have line graph not plot entries that repeat

    I have a column with entries that make up a line graph. Between some of the entries there might be segments where the value just stays the same for a number of rows - which just result in a flat graph for that segment. What I would like is for those segments not to be plotted in the graph, so that the next point on the graph will be where the entry changes to something different. Any way to achieve this? Thank you!
    Those of you who think you know everything are annoying to those of us who do!

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Have line graph not plot entries that repeat

    Short but useless answer -- yes I'm sure there is some way to achieve this. We will probably need to know more about your data, how it is arranged in the spreadsheet, exactly what you are trying to show in the chart, before we can be more specific than that.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Have line graph not plot entries that repeat

    If I understand the request, and if you want to retain the original data I'd copy it to another column, then use the Remove Duplicates functionality to remove the repeated values and then plot the reduced set of data.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    07-19-2005
    Posts
    26

    Re: Have line graph not plot entries that repeat

    Just to clarify what I want, below is a snip of what a column might look like, just with many more entries (around one thousand). What I want is for 2900 to only be shown once, and then ignore the three subsequent identical entries. Copying the column and removing the duplicates would work, but the column grows longer every day, so that would require some manual effort each time more values are added to it - which naturally isn't much to root for.

    2560
    3600
    3430
    2900
    2900
    2900
    2900
    2650
    2400
    2770

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Have line graph not plot entries that repeat

    Perhaps this will help.
    1. Put the values in a table so that as new values are added the table will expand
    2. In an adjacent column place the following: =A2<>A1
    3. Populate the column adjacent to that one using: =IFERROR(INDEX([Entry],AGGREGATE(15,6,(ROW([Entry])-ROW(Table1[#Headers]))/([Non Repeating]=TRUE),ROWS(A$1:A1))),NA())
    4. Use the values in the last column for the graph.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Have line graph not plot entries that repeat

    Quote Originally Posted by Siberian View Post
    Just to clarify what I want, below is a snip of what a column might look like, just with many more entries (around one thousand). What I want is for 2900 to only be shown once, and then ignore the three subsequent identical entries. Copying the column and removing the duplicates would work, but the column grows longer every day, so that would require some manual effort each time more values are added to it - which naturally isn't much to root for.
    It wouldn't require any manual entry, just use a simle macro. e.g.

    Please Login or Register  to view this content.
    Just select any cell in the range and run the macro. It assumes there is no adjacent column values hence the .CurrentRegion bit.
    If there is an adjacent column for which you want to retain the values then select the whole range and just use

    Please Login or Register  to view this content.
    The other assumption is that there is no column label above the data. If not change the Header:= to xlYes

    Even better, if the column of data is always in the same position but will vay in length, then create a dynamic range name that will always apply to the whole range of cells, and use that range name in the remove duplicates macro. i.e. the Range name, say 'MyRange' would be defined like

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    then in the macro

    Please Login or Register  to view this content.
    Last edited by Richard Buttrey; 03-01-2020 at 08:17 AM.

+ 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. Plot dates of campaigns on a line graph
    By bjbboats in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-21-2016, 10:35 AM
  2. plot line through graph minimums
    By sabriy in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 09-05-2016, 06:38 PM
  3. [SOLVED] HOw to plot a line graph to show Speed vs Time of Day
    By nsmjc in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 08-28-2016, 12:34 AM
  4. Macros to plot data in a line graph
    By taimysho0 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2014, 05:27 PM
  5. Line Graph - Do plot zero, Don't plot #NA
    By Janc in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 04-01-2012, 05:45 PM
  6. [SOLVED] how do I plot a constant value in a line graph?
    By Debby Blaine in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 04-11-2006, 04:15 AM
  7. [SOLVED] Scatter plot and line graph combination
    By Tim Gilderseeve in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-11-2005, 03:05 AM

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